Skip to content

JS String Escaper

Escape text for safe use inside JavaScript or JSON string literals.

Runs locally · Nothing uploaded
Plain text
Escaped string
Result will appear here…
Advertisement

About JS String Escaper

Escapes quotes, backslashes, newlines, tabs, and control characters so the result can be pasted between quotes in JavaScript or JSON without breaking the literal. Also useful for embedding multi-line text in a single-line string. The same escaping rules make output valid inside JSON strings.

Related tools

All tools · More in this category