JSON Escape and Unescape

Escape and unescape text for JSON, JavaScript, SQL, CSV, regular expressions, HTML attributes and shell strings. Handles quotes, newlines, tabs and Unicode correctly.

  • Free, no sign-up
  • Runs in your browser
  • Your data stays private

How to use the JSON Escape and Unescape

  1. Paste your text or escaped string.
  2. Choose Escape or Unescape and the format.
  3. Copy the result.

Why use this JSON Escape and Unescape

  • Seven formatsJSON, JavaScript, SQL, CSV, regex, HTML attributes and shell.
  • Correct escapesQuotes, backslashes, newlines, tabs and control characters are handled.
  • Unicode optionEscape non-ASCII characters as \uXXXX when you need ASCII-only output.
  • Forgiving unescapeAccepts strings with or without surrounding quotes.

Frequently asked questions

How do I escape a string for JSON?

Choose JSON and Escape. Quotes, backslashes and line breaks are converted, and the result is wrapped in quotes if you like.

How do I unescape a JSON string?

Choose Unescape and paste the string. \n becomes a real line break and \" becomes a quote.

How do I escape single quotes in SQL?

Choose SQL. Each single quote is doubled, which is the standard SQL escape.

Related tools

More Developer Tools

User Reviews

–
No ratings yet
Write a review
Your rating *

Your email is never published. Reviews are moderated, and links aren't allowed.

What users are saying

No reviews yet

Be the first to share your experience with this tool — your feedback helps others.