String to JSON Converter

Feedback

Convert escaped JSON string back to formatted JSON

Input String

0 characters

JSON Output

Usage Instructions

  1. Paste JSON string in the left input box (can be code-wrapped or pure JSON string)
  2. Tool will automatically identify and remove common programming language code wrappers
  3. Automatically handles escape characters (like \", \\, \n, etc.)
  4. Select output format (formatted or minified)
  5. If formatted is selected, you can set the indent size
  6. Converted JSON will automatically display on the right
  7. Click "Copy" or "Download" to save the result

Supported Input Formats:

  • JavaScript/TypeScript: const jsonStr = "..."
  • Python: json_str = """..."""
  • Java: String jsonStr = "..."
  • C#: string jsonStr = @"..."
  • Go: jsonStr := `...`
  • PHP: $jsonStr = "..."
  • Pure JSON String: "{...}"

Use Cases:

  • Extract and format JSON strings from code
  • View JSON data embedded in code during debugging
  • Convert JSON strings from logs to readable format
  • Handle JSON example code from API documentation
  • Convert JSON strings in test cases

Auto-handled Escape Characters:

  • \" → Double quote
  • \\ → Backslash
  • \n → Newline
  • \t → Tab
  • \r → Carriage return

About String to JSON Converter

Convert JSON strings from code back to properly formatted JSON. Automatically detects and removes code wrappers from multiple programming languages (JavaScript, Python, Java, C#, Go, PHP), handles escape characters (\, ", \n, \t), and outputs clean, readable JSON. Perfect for extracting JSON from logs, debugging code strings, processing API documentation examples, and converting test data. Supports both formatted and minified output with customizable indentation.

Try Our Browser Extension

Access essential tools instantly from your browser sidebar. Encode, decode, format, and hash - all without leaving your workflow.

Lightning fast
Privacy first
Search enabled
Get Chrome Extension