ToolVaults

String Escape & Unescape — JSON, JS, HTML, URI, SQL

Escape and unescape strings for five formats: JSON, JavaScript, HTML, URI components, and SQL literals. Fast, browser-only, safe for copy-paste.

Runs 100% in your browser — nothing is uploaded.

Wraps in quotes; escapes " \ \n \t \r control chars
Output

Frequently asked

When should I use each mode?

JSON when embedding a value into JSON. JS for template strings or inline strings in code. HTML for content injected into a page. URI for query params or path segments. SQL when building a literal by hand (though you should really use parameterized queries).

Is SQL escaping safe against injection?

This tool only doubles single quotes — enough for a literal string in most SQL dialects, but NOT a substitute for parameterization or prepared statements in application code. Use it for one-off ad-hoc queries only.

What about Unicode?

JSON mode preserves Unicode as-is (JSON.stringify does not escape by default). JS mode does the same. HTML entity encoding covers the reserved 5 chars only; add numeric character references (&#…;) if you also need to encode arbitrary code points.

Related tools