print() formats the output, while write() just prints the characters it is given. print() handles many argument types, converting them into printable strings of characters with String.valueOf(), while write() just handles single characters, arrays of characters, and strings.

To illustrate the difference, write(int) interprets the argument as a single character to be printed, while print(int) converts the integer into a character string. write(49) prints a "1", while print(49) prints "49".

source: http://www.coderanch.com/t/398792/java/java/write-print

Answer from Maantje on Stack Overflow
🌐
Arduino Forum
forum.arduino.cc › projects › programming
Difference between the Commands Client.write and .print - Programming - Arduino Forum
November 28, 2014 - Hi Arduino Community I'm using an Arduino Mega 2560 together with an Ethernet Shield as Ethernet Client. My Host or Server is a LabView Program on Windows. Now i'm trying to identify the diferente between the two commands Client.write() and Client.print(). Both are working properly and in the Reference it's not Explained that specific... thanks for your explanations vortex
Discussions

python - f.write vs print >> f - Stack Overflow
Is there a difference between the two? Or is any one more Pythonic? I'm trying to write a bunch of HTML to file so I need a bunch of write/print statements through my file(but I don't need a templating engine). More on stackoverflow.com
🌐 stackoverflow.com
Difference between `write` and `print`
The documentation entries for write and print seem very similar. There are a few minor differences (write allows file names as well as I/O streams and returns the number of bytes written, while print calls show if the argument doesn’t have a canonical text representation), but it seems like ... More on discourse.julialang.org
🌐 discourse.julialang.org
1
1
November 7, 2017
meaning - What's the difference between print and write? - English Language & Usage Stack Exchange
The specific example comes from a Sherlock Holmes story: Yes, sir; prints it in pencil. Printing is a clumsy process. Why not write? What is the difference between print and write in this case? C... More on english.stackexchange.com
🌐 english.stackexchange.com
November 4, 2021
[deleted by user]
That’s always been my understanding. There’s printing and there’s writing. They are not synonymous. More on reddit.com
🌐 r/Handwriting
28
20
May 19, 2022
🌐
Coderanch
coderanch.com › t › 398792 › java › write-print
write() Vs print() (Beginning Java forum at Coderanch)
print() formats the output, while write() just prints the characters it is given. print() handles many argument types, converting them into printable strings of characters with String.valueOf(), while write() just handles single characters, arrays of characters, and strings.
🌐
WikiDiff
wikidiff.com › write › print
Write vs Print - What's the difference? | WikiDiff
June 14, 2025 - As verbs the difference between write and print is that write is (ambitransitive) to form letters, words or symbols on a surface in order to communicate while print is...
🌐
AskDifference
askdifference.com › write-vs-print
Write vs. Print — What’s the Difference?
November 29, 2019 - Write involves creating characters or symbols manually, often implying a personal, original process, while print refers to reproducing text or images, typically via mechanical or digital means, emphasizing mass production or dissemination.
Top answer
1 of 7
41

print does things file.write doesn't, allowing you to skip string formatting for some basic things.

It inserts spaces between arguments and appends the line terminator.

print "a", "b" # prints something like "a b\n"

It calls the __str__ or __repr__ special methods of an object to convert it to a string.

print 1 # prints something like "1\n"

You would have to manually do these things if you used file.write instead of print.

2 of 7
22

I disagree somewhat with several of the opinions expressed here, that print >> f is redundant and should be avoided in favour of f.write.

print and file.write are quite different operations. file.write just directly writes a string to a file. print is more like "render values to stdout as text". Naturally, the result of rendering a string as text is just the string, so print >> f, my_string and f.write(my_string) are nearly interchangeable (except for the addition of a newline). But your choice between file.write and print should normally be based on what you're doing; are you writing a string to a file, or are you rendering values to a file?

Sure, print is not strictly necessary, in that you can implement it with file.write. But then file.write is not strictly necessary, because you can implement it with the operations in os for dealing with file descriptors. Really they're operations on different levels, and you should use whichever is more most appropriate for your use (normally the level other nearby code is working on, or the highest level that doesn't get in your way).

I do feel that the print >> f syntax is fairly horrible, and is a really good example of why print should have been a function all along. This is much improved in Python 3. But even if you're writing Python 2 code that you're planning to port to Python 3, it is much easier to convert print >> f, thing1, thing2, thing3, ... to print(thing1, thing2, thing3, file=f) than it is to convert the circumlocution where you roll your own code to do the equivalent of print's rendering and then call f.write(text). I'm pretty sure the semi-automatic converter from Python 2 to Python 3 will even do the conversion for you, which it couldn't possibly do if you avoid the print >> f form.

Bottom line: use print to render values to stdout (or to a file). Use f.write to write text to a file.

🌐
Baeldung
baeldung.com › home › java › java io › printwriter write() vs print() method in java
PrintWriter write() vs print() Method in Java | Baeldung
April 16, 2024 - In this article, we’ll talk about the PrintWriter class of the Java IO package. Specifically, we’ll discuss two of its methods, write() and print(), and their differences.
Find elsewhere
Top answer
1 of 1
3

In the past "writing" usually meant cursive writing for something handwritten. After Holmes asks "Why not write? What would it suggest, Watson?” Watson replies “That he desired to conceal his handwriting.” (The Adventure of the Red Circle)

My print Collins documents this sense:

write (v.)

6. To write (words) in cursive as opposed to printed style.

as does the collegiate Webster's New World Dictionary:

2. To form or inscribe (words) in cursive style: opposed to print.

The print New Oxford American Dictionary has:

(Intrans.) Write in a cursive hand, as opposed to printing individual letters.

However, I haven't yet found this sense in the OED or in an online dictionary. When I grew up, this was a distinction made in school: write meant cursive writing as opposed to print.


This form from the 1950s has a line for the Purchaser's Signature with the instruction "(WRITE DO NOT PRINT)"

Other examples of "Write do not print" on forms: Ex. 1 Ex. 2

"Please write (DO NOT PRINT) the following statement. Sign and date." appears in a 2002 Official LSAT Prep Test

But we took the gas bill over and found the appropriate desk. You had to be able to write your name or print it, and I was frightened because I never had the Spencerian copperplate hand that of course all the girls picked up. But with my tongue sticking out in concentration, I wrote my name, showed the gas bill, and got a temporary library card. Caterine Burns; The Moth

Please write or print so that your writing may be read by someone who is not familiar with your handwriting.
...
Again, you may use cursive writing or you may print. E. Silas et al.; Cracking the SSAT & ISEE


longhand (n.) presents a similar ambiguity:

a: Characters or words written out fully by hand

b: Cursive writing m-w


As far as I can determine, the verb print does not necessarily mean in all caps (unless so specified):

To write in letters shaped like those of ordinary roman text type m-w

where roman (text) means not in italics, i.e., any standard print font or letterforms.

Write (text) clearly without joining the letters.

Print your name and address on the back of the check Lexico

🌐
Quora
quora.com › What-is-the-difference-between-the-write-and-print-functions-in-Python
What is the difference between the write and print functions in Python? - Quora
The print() function sends str data and always adds the OS defined newline (end of line characters). This is '\r' on a Mac or '\r\n' on Windows. The write() method sends raw data as bytes or str to the target device.
🌐
Reddit
reddit.com › r/handwriting › [deleted by user]
Writing vs. printing : r/Handwriting
May 19, 2022 - I'm 29 (millenial) and was taught handwriting = cursive and print = not cursive. I went to public and catholic school in Massachusetts. My grandmother won awards for her Palmer method (bet you haven't heard that one in a while!!) ... Yess! I love getting cards from my mom because how she writes my shipping address hahaha and my grandmas was even more amazing!
🌐
Grammar Checker
grammarchecker.io › difference › write-vs-print
Write vs. Print | Grammar Checker - Online Editor
write or name the letters that comprise the conventionally accepted form of (a word or part of a word); ... mark (letters, words, or other symbols) on a surface, typically paper, with a pen, pencil, or similar implement ... compose (a text or work) for written or printed reproduction or publication; put into literary form and set down in writing
🌐
SciVision
scivision.dev › print-vs-write-fortran
print vs write Fortran statements | Scientific Computing
December 16, 2024 - Writing to console effectively: write(*,*) grew out of non-standard use of Fortran 66’s write statement that was introduced for device-independent sequential I/O. Although write(*,*) became part of Fortran 77 for printing to console standard output, the Fortran 77 print command is more concise and more importantly visually distinct.
🌐
The Content Authority
thecontentauthority.com › home › grammar › word usage › write vs print: when to use each one in writing
Write vs Print: When To Use Each One In Writing
June 13, 2023 - As you can see, “write” is used to describe the act of physically putting words down on paper or another surface. The word “print” refers to the act of producing written material using a printer or other printing device.
Top answer
1 of 5
38

Serial.write is more down to earth , it is simple and fast, it is made to talk binary, one byte at a time. example:

Serial.write(0x45);   // will write 0100 0101 to the cable

Serial.print in the other hand is more versatile , it will do the conversion for you from ASCII to binary it also can convert to BIN/ HEX/OCT/DEC but you need to specify a second argument like so

Serial.print(76, BIN) gives "0100 1100"
Serial.print(76, OCT) gives "114"
Serial.print("L", DEC) gives "76"
Serial.print(76, HEX) gives "4C" 

more examples with visual serial output :

Code:

  Serial.write(0x48);   // H
  Serial.write(0x45);   // E
  Serial.write(0x4C);   // L
  Serial.write(0x4C);   // L
  Serial.write(0x4F);   // O

SERIAL OUTPUT :

Code:

  Serial.print("HELLO");

SERIAL OUTPUT :

Serial.println() in the other hand will add end of line 2 bytes 0x0D and 0x0A as you can see in the frame

Code:

  Serial.println("HELLO");

SERIAL OUTPUT :

2 of 5
25

From the Arduino site for Serial.write and Serial.print:

Serial.write()

Writes binary data to the serial port. This data is sent as a byte or series of bytes; to send the characters representing the digits of a number use the print() function instead.

Serial.print()

Prints data to the serial port as human-readable ASCII text. This command can take many forms. Numbers are printed using an ASCII character for each digit. Floats are similarly printed as ASCII digits, defaulting to two decimal places. Bytes are sent as a single character. Characters and strings are sent as is

🌐
Parseltongue
parseltongue.co.in › print-vs-sysstdoutwrite
ParselTongue - print vs sys.stdout.write
September 23, 2022 - import timeit import sys def print_hello(): print("print hello") def stdout_hello(): sys.stdout.write("stdout hello") time_for_print = timeit.timeit(print_hello, number=1000_000) time_for_stdout = timeit.timeit(stdout_hello, number=1000_000) print("Time for print: ", time_for_print) print("Time for stdout: ", time_for_stdout)