String Escape Online

What is string escaping?

String escaping replaces special characters with a safe sequence so the text can sit inside a JSON string (or other quoted literal) without breaking the syntax. A quote becomes \", a backslash becomes \\, and characters like newline and tab become \n and \t. Without that, a quote in the value would close the string early, and a raw newline would be invalid JSON.

JSON requires escaping quotes, backslashes, and control characters. Optionally, you can escape all non-ASCII as \uXXXX. U+2028 and U+2029 are escaped for safe embedding in inline <script> tags.

Examples:

CaseInputEscaped output
Quotes and backslashHe said "hi" \ pathHe said \"hi\" \\ path
Newline and tabline1 line2 indentedline1\nline2\tindented
JSON{"name":"abc"}{\"name\":\"abc\"}