Newline is a character that marks the end of a line of text. As the name implies, it is used to create a new line in a text document, database field, or any other block of text.

When typing in a word processor, you can enter a newline character by pressing the "Enter" or "Return" key on your keyboard. This creates a line break (also known as a "carriage return" or "line feed") in the text and moves the cursor to the beginning of the next line. When a line break occurs at the end of a block of text, it is called a trailing newline.

The newline character is important in computer programming, since it allows programmers to search for line breaks in text files. For example, if a data file lists one element per line, the items can be delimited by newline characters. In most modern programming languages, the newline character is represented by either "\n" or "\r". Some databases, like MySQL, store line breaks using a combination of "\r\n". By searching for newline characters in text strings, programmers can parse documents line by line and remove unwanted line breaks.

Updated March 1, 2011 by Per C.

quizTest Your Knowledge

GPS satellites orbit the earth at approximately what altitude?

5,000 miles (8,000 kilometers)
8,000 miles (12,900 kilometers)
12,000 miles (19,300 kilometers)
20,000 miles (32,000 kilometers)
Correct! Incorrect!     View the GPS definition.
More Quizzes →

The Tech Terms Computer Dictionary

The definition of Newline on this page is an original definition written by the team. If you would like to reference this page or cite this definition, please use the green citation links above.

The goal of is to explain computer terminology in a way that is easy to understand. We strive for simplicity and accuracy with every definition we publish. If you have feedback about this definition or would like to suggest a new technical term, please contact us.

Sign up for the free TechTerms Newsletter

How often would you like to receive an email?

You can unsubscribe or change your frequency setting at any time using the links available in each email.

Questions? Please contact us.