RUNWEBTOOLS
English

Escape Sequences Reference: \n, \t, \\ and String Escapes

Escape sequences let you put special characters into a string — a newline, a tab, a quote that would otherwise end the string, or a character by its code. A backslash (\) starts an escape. These are near-universal across JSON, JavaScript, Python, Java, C, and more. To see the code point behind any character, use the Unicode converter.

Updated 2026-07-06

SequenceRepresentsNotes
\nNewline (line feed)The standard line break in most languages
\rCarriage returnReturn to line start; part of Windows endings
\r\nWindows line endingCarriage return + line feed (CRLF)
\tTabHorizontal tab
\\BackslashA single literal backslash
\"Double quoteA quote inside a double-quoted string
\'Single quoteA quote inside a single-quoted string
\0Null characterThe zero byte (string terminator in C)
\bBackspaceRarely used in text
\fForm feedPage break; rarely used
\vVertical tabRarely used
\uXXXXUnicode (4 hex digits)e.g. \u00e9 = é, \u20ac = €
\xXXByte / Latin-1 (2 hex digits)e.g. \xe9 in some languages
\u{XXXX}Unicode code point (ES6)Braces allow code points above FFFF, e.g. emoji

The one that trips people up is the backslash itself: to write a literal backslash you need two (\\), because a single one starts an escape. This is why Windows file paths look doubled inside code and JSON strings.

Related tools