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.

Definitions by

The definition of Newline on this page is an original definition. If you would like to reference this page or cite this definition, you can 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 the Newline definition or would like to suggest a new technical term, please contact us.

Want to learn more tech terms? Subscribe to the daily or weekly newsletter and get featured terms and quizzes delivered to your inbox.

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.