Explorar ferramentas

Loading…

Guide

How to use this tool, examples, and related tips.

How to Use the JSON Escape Tool

Paste your raw string into the input field.

The tool instantly escapes all characters that would break valid JSON — backslashes, double quotes, newlines, tabs, and control characters.

Copy the escaped output and embed it directly into your JSON payload.

What Is JSON Escaping?

JSON has a strict syntax for string values. Certain characters — double quotes ("), backslashes (\), and control characters like newlines (\n) and tabs (\t) — must be escaped with a backslash prefix before they can appear inside a JSON string. Without escaping, these characters break JSON parsing and cause hard-to-debug errors. JSON escaping is the process of transforming a raw string so it's safe to use as a JSON value. This is distinct from URL encoding or HTML encoding — JSON has its own escape rules defined in RFC 8259.

When to Use This Tool

Embedding raw text in JSON payloads — When you need to include multi-line strings, file contents, or user-generated text as a JSON value.

Debugging JSON parse errors — When a JSON string containing quotes or backslashes is silently breaking your parser.

Preparing strings for API requests — When constructing JSON request bodies manually and including dynamic content.

Working with regex patterns in JSON — Regex strings are full of backslashes that need double-escaping inside JSON.

Related Tools

  • JSON unescape
  • JSON formatter & validator
  • JSON validator
  • XML escape
  • JavaScript escape

FAQ

Answers about this tool and how your data is handled.

What characters does JSON escaping handle?

Double quotes ("), backslashes (\), and control characters including newline (\n), carriage return (\r), tab (\t), form feed (\f), and backspace (\b). Unicode control characters (U+0000–U+001F) are also escaped.

Is this the same as URL encoding?

No. URL encoding uses percent-encoding (e.g., %20 for a space) and targets a different set of characters. JSON escaping uses backslash sequences and is only relevant inside JSON string values.

Does this tool send my data to a server?

No. The JSON escape tool runs entirely in your browser. No data leaves your machine.

Will this escape the entire JSON object, or just a string value?

This tool escapes a raw string so it can be safely placed as a value inside JSON. If you want to format or validate a full JSON document, use the JSON formatter & validator.

What happens if I escape an already-escaped string?

You'll get double-escaped output (e.g., \\n instead of \n). Only pass raw, unescaped strings into this tool.

Primeiro a mesma categoria, depois outras utilidades.