Clean messy JSON
Format API payloads, request bodies, and config snippets so they are readable and easy to copy back out.
Local Code Format is a browser-based tool site for developers who need to clean JSON, check whether JSON is valid, make SQL readable, tidy HTML, or compare two versions of text without sending code to a server.
Most visits fall into one of these jobs: make JSON readable, check whether JSON is valid, clean up SQL, tidy HTML, or compare two versions of text before you ship.
Format API payloads, request bodies, and config snippets so they are readable and easy to copy back out.
Check whether broken JSON will parse before it causes an error in a request, build step, or config file.
Make SQL easier to read, tidy HTML without changing structure, and compare text changes without leaving the browser.
Here's how our tools transform messy code into clean, readable formats. All processing happens locally in your browser.
{"apiVersion":"v1","data":{"users":[{"id":1,"name":"Alex","email":"alex@example.com","active":true},{"id":2,"name":"Sam","email":"sam@example.com","active":false}],"total":2},"status":"success"}
{
"apiVersion": "v1",
"data": {
"users": [
{
"id": 1,
"name": "Alex",
"email": "alex@example.com",
"active": true
},
{
"id": 2,
"name": "Sam",
"email": "sam@example.com",
"active": false
}
],
"total": 2
},
"status": "success"
}
Use case: Debugging API responses, cleaning config files, preparing data for documentation
SELECT u.id,u.name,u.email,o.total_amount,o.order_date FROM users u LEFT JOIN orders o ON u.id=o.user_id WHERE u.active=1 AND o.order_date>='2024-01-01' ORDER BY o.total_amount DESC LIMIT 10
SELECT
u.id,
u.name,
u.email,
o.total_amount,
o.order_date
FROM users u
LEFT JOIN orders o ON u.id = o.user_id
WHERE u.active = 1
AND o.order_date >= '2024-01-01'
ORDER BY o.total_amount DESC
LIMIT 10
Use case: Code reviews, query optimization, sharing SQL with team members
{
"name": "Test",
"value": 123
"active": true
}
โ Error: Missing comma after "value": 123
{
"name": "Test",
"value": 123,
"active": true
}
โ Valid JSON
Use case: API development, configuration validation, data quality checks
<!DOCTYPE html><html><head><title>Example</title></head><body><div class="container"><h1>Hello</h1><p>This is a test</p></div></body></html>
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
</head>
<body>
<div class="container">
<h1>Hello</h1>
<p>This is a test</p>
</div>
</body>
</html>
Use case: Debugging markup, code reviews, learning HTML structure
Copy the "Before" examples into our tools to see the transformation instantly.
Study the formatting patterns to understand how our tools structure code.
Use the same principles to format your own JSON, SQL, HTML, and other code.
Remember: All processing happens locally in your browser. Your code never leaves your computer.
Use one of these pages to get straight into the task without creating an account or uploading code elsewhere.
Pretty-print, minify, and clean JSON safely in the browser when you need a readable payload fast.
Check JSON validity, pinpoint parse errors, and move directly into formatting or repair.
Make long SQL queries readable before review, debugging, or sharing a cleaned-up query with a teammate.
Indent messy markup, improve readability, and inspect tag structure without leaving the browser.
Compare two text blocks and spot line-by-line changes quickly when debugging code or content.
Read this when you need to know why browser-only tools are safer for request bodies, logs, queries, and config files.
If you are not sure whether you should format first, validate first, or open a more specific page, start with one of these short paths.
Use these pages when you need to fix broken payloads, clean a response body, or make JSON readable before sharing it with a teammate.
These pages are for the jobs that happen right after cleanup: making queries readable, inspecting markup, and spotting text changes before you ship them.
These guides are here for the questions that usually come right after opening a tool: what to use first, how to handle sensitive code safely, and how to avoid breaking markup or queries.
Start here if you are trying to understand what tool to use, how to validate first, or how to avoid exposing sensitive payloads.
Use these when the problem is not โformat thisโ but โhelp me inspect this safely and understand what changed.โ
Use Local Code Format when you want to clean JSON, validate a payload, format SQL, inspect HTML, or compare text changes without pasting sensitive material into a random third-party tool. Open the tool, paste what you have, get the result, and move on.