String to JSON Converter
Convert escaped JSON string back to formatted JSON
Input String
0 characters
JSON Output
Usage Instructions
- Paste JSON string in the left input box (can be code-wrapped or pure JSON string)
- Tool will automatically identify and remove common programming language code wrappers
- Automatically handles escape characters (like \", \\, \n, etc.)
- Select output format (formatted or minified)
- If formatted is selected, you can set the indent size
- Converted JSON will automatically display on the right
- 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.
Explore More JSON Tools
Discover all tools in the json tools category