Dev Tools

Escape Sequence Reference

Reference table of escape sequences for JavaScript, Python, Java, C, and Go.

SequenceDescriptionExampleLanguages
\nNewline (line feed)"line1\nline2"
JavaScriptPythonJavaCGo
\rCarriage return"hello\rworld"
JavaScriptPythonJavaCGo
\tHorizontal tab"col1\tcol2"
JavaScriptPythonJavaCGo
\\Backslash"C:\\Users"
JavaScriptPythonJavaCGo
\"Double quote"say \"hi\""
JavaScriptPythonJavaCGo
\'Single quote'it\'s'
JavaScriptPythonJavaCGo
\0Null character"end\0"
JavaScriptPythonJavaCGo
\aAlert (bell)"\a"
PythonJavaCGo
\bBackspace"abc\b"
JavaScriptPythonJavaCGo
\fForm feed"page\f"
JavaScriptPythonJavaCGo
\vVertical tab"\v"
JavaScriptPythonJavaCGo
\xNNHex byte value (2 digits)"\x41" = "A"
JavaScriptPythonJavaCGo
\uNNNNUnicode escape (4 hex digits)"\u0041" = "A"
JavaScriptPythonJavaGo
\u{N...}Unicode code point (variable length)"\u{1F600}" = emoji
JavaScriptPython
\UNNNNNNNNUnicode escape (8 hex digits)"\U0001F600"
PythonGo
\NNNOctal escape (1-3 digits)"\101" = "A"
PythonJavaCGo
\?Question mark (trigraph avoidance)"\?"
C
\N{name}Unicode character by name"\N{SNOWMAN}"
Python
Was this page helpful?

Related tools

About Escape Sequence Reference

Escape and unescape string literals, revealing control characters like \n, \t, and \uXXXX. Useful for embedding text safely in code and for reading escaped strings from logs.

How to use

  1. Paste raw text to escape, or an escaped string to unescape.
  2. Choose the direction.
  3. Copy the result into your code or config.

Frequently asked questions

Which escapes are supported?
Common ones such as \n, \t, \r, \\, quotes, and \uXXXX unicode escapes.
Why escape strings?
Escaping lets you embed newlines, quotes, and special characters in string literals without breaking the syntax.