JSON String Toolkit · 100% Local · Browser Only

    JSON Escape Unescape

    Escape JSON, unescape nested strings, decode Unicode, clean API logs, inspect JSONPaths, and generate language-ready string literals locally.

    Browser only Valid JSON recovered Normal JSON
    Input
    23 lines
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    Output
    1 line
    1

    Statistics

    Characters
    447
    Escaped chars
    0
    Quotes
    50
    Unicode
    0
    Objects
    3
    Arrays
    1
    Depth
    3
    Size
    447 B

    Character Inspector

    newline
    Line break
    \n
    tab
    Horizontal tab
    \t
    carriage return
    Carriage return
    \r
    quote
    Double quote
    \"
    backslash
    Backslash
    \\
    slash
    Forward slash
    \/
    backspace
    Backspace
    \b
    form feed
    Form feed
    \f
    unicode
    Unicode code point
    \uXXXX

    Tree View & JSONPath

    Developer Reference
    Updated for 2026 Web & API Standards

    Complete JSON String & Escape Toolkit

    Working with JSON in real-world applications often involves dealing with escaped strings, nested payload wrappers, double serialization in log files, and language-specific quote rules. This tool provides a unified, browser-side workspace to escape, unescape, clean, format, and inspect JSON payloads of any complexity.

    1x and 2x Escape & Unescape

    Convert quotes, backslashes, and control characters once or twice recursively for nested string placements.

    json escape, double escape json, unescape json online

    API Log Cleaner & Extraction

    Automatically strip log prefixes (INFO, DEBUG) and extract valid embedded JSON objects from complex log lines.

    api log json cleaner, extract json from logs

    Nested JSON & Path Inspector

    Parse multi-layer JSON payloads, extract deeply embedded strings, and inspect JSONPath values instantly.

    nested json string, jsonpath inspector, unescape nested json

    Multi-Language Generator

    Generate properly escaped string literals for JavaScript, TypeScript, Python, Java, C#, Go, PHP, and Rust.

    json string literal generator, escape json java python

    Interactive Escape Level Comparison

    Compare raw JSON against 1x and 2x escaped representations

    Standard JSON Object
    {
      "id": 101,
      "service": "auth-api",
      "payload": {
        "user": "alex",
        "role": "admin"
      },
      "message": "Line 1\nLine 2"
    }

    JSON Escape Characters Reference

    Standard control tokens defined in the ECMA-404 JSON Data Interchange Standard

    SequenceCharacter NameHex CodePurpose & Usage Description
    \"Double QuoteU+0022Escapes quotes inside string literals so they don't terminate the string.
    \\BackslashU+005CEscapes the backslash character itself to avoid accidental escape sequences.
    \nNewlineU+000ARepresents a line feed break character inside single-line JSON values.
    \rCarriage ReturnU+000DCarriage return character, frequently paired with \n on Windows.
    \tTabU+0009Horizontal tab spacing character inside string content.
    \bBackspaceU+0008Backspace control character inside string literals.
    \fForm FeedU+000CForm feed page break character.
    \/Forward SlashU+002FOptional escape for forward slashes (useful to prevent </script> HTML injection).
    \uXXXXUnicode EscapeU+XXXXFour-digit hexadecimal code representing arbitrary UTF-16 characters.

    Programmatic Escape & Unescape

    Code examples for escaping and unescaping JSON across languages

    JavaScript / Node.js — Escape
    // 1x Escape
    const raw = { user: "alex", active: true };
    const escaped1x = JSON.stringify(JSON.stringify(raw)).slice(1, -1);
    
    // 2x Escape
    const escaped2x = JSON.stringify(escaped1x).slice(1, -1);
    JavaScript / Node.js — Unescape
    // Unescape JSON string
    const escapedStr = '{\"user\":\"alex\"}';
    const unescaped = JSON.parse(escapedStr); // Returns Object or String

    Who Uses JSON Escape & Unescape?

    Software Engineers

    • Embed structured JSON payloads inside code literals or API request strings.
    • Safely escape quotes and backslashes for database inserts or SQL queries.
    • Unescape double-encoded API responses during local debugging.

    QA & Integration Testers

    • Simulate nested string payloads and mock API log structures.
    • Verify escape handling in microservices and webhook payloads.
    • Inspect Unicode sequences and special control characters in raw outputs.

    DevOps & Sysadmins

    • Embed JSON blocks safely inside Kubernetes ConfigMaps, Helm charts, or Terraform.
    • Extract and unescape JSON messages from CloudWatch, Kibana, or Datadog logs.
    • Clean double-escaped environment variables without manual regex guesswork.

    Common Pitfalls to Avoid

    • Accidentally double-escaping backslashes when copying pre-escaped console output.
    • Using global string replaces (e.g. str.replace(/\\/g, '')) which breaks valid escaped quotes or newlines.
    • Assuming JSON.parse() can handle unquoted keys or trailing commas without prior sanitization.
    • Sending sensitive API keys or credentials to third-party servers instead of using local browser tools.

    Best Practices for JSON Strings

    • Verify your target escape level: 1x for standard JSON API string properties, 2x for double-serialized database columns or shell scripts.
    • Use local-only browser converters to guarantee security and compliance for production payloads.
    • Leverage the layout-preserving Format option when reading multiline escaped strings inside config files.
    • Check character counts and unicode representations when debugging multi-byte or international text strings.

    Frequently Asked Questions

    Everything you need to know about JSON escaping and unescaping

    Related Developer Tools

    Explore more free developer tools to speed up debugging, testing, and development.