Home : Technical Terms : Newline Definition


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

Cite this definition:


TechTerms - The Tech Terms Computer Dictionary

This page contains a technical definition of Newline. It explains in computing terminology what Newline means and is one of many technical terms in the TechTerms dictionary.

All definitions on the TechTerms website are written to be technically accurate but also easy to understand. If you find this Newline definition to be helpful, you can reference it using the citation links above. If you think a term should be updated or added to the TechTerms dictionary, please email TechTerms!