codefmt formats, repairs, and inspects JSON in your browser. paste any JSON and it pretty-prints instantly: 2-space, 4-space, tab, or minified output, optional key sorting, line numbers in both editors. broken input gets an exact error position. almost-JSON gets an opt-in repair pass. valid documents get a tree view, a cursor path breadcrumb, and size stats. nothing is uploaded, so it works as a JSON repair tool even for payloads you'd never paste into someone else's server.
when your input doesn't parse, the error banner reports the exact line and column of the first problem, the editor draws an inline squiggle under the offending spot, and a go to error button moves your cursor straight there. fixing invalid JSON online becomes a short loop: paste, jump, fix, done. the output keeps showing the last valid result while you type through broken states, so you always have something to compare against.
a lot of "broken" JSON turns out to be JavaScript object syntax, a Python repr, or a config file with comments. the repair toggle fixes six categories: comments (// and /* */), trailing commas, single-quoted strings, unquoted object keys, the Python literals True, False, and None, and JavaScript's undefined (rewritten to null). it also strips the invisible byte-order mark some Windows editors put in front of a file, and tells you it did. repair is opt-in and off by default because it rewrites your input. when it runs, a notice above the output lists exactly what changed, for example repaired: 2 trailing commas, 1 unquoted key. and when strict parsing fails on input repair could handle, the error banner offers a one-click enable repair action, so a trailing-comma fix is never more than a click away.
JavaScript's JSON.parse stores every number as a 64-bit float, which is only exact for integers up to 9,007,199,254,740,991. run a payload with a 19-digit id like 1144241312345678901 through a parse-and-reprint round trip and it silently becomes 1144241312345678800. the last digits round away. nothing warns you. written decimals lose their form too, so 1.10 comes back as 1.1. codefmt's engine never converts numbers to floats. it reprints each number's original digits from the source text, so database ids, financial amounts, and version-like decimals survive formatting byte for byte. duplicate keys are preserved the same way, exactly as your document wrote them.
the output pane has a text or tree toggle: tree view renders the document as an expandable tree with copy path and copy value on every node. above the input, a breadcrumb follows your cursor and shows the path of the node under it, like data.items[3].name. a stats strip reports input and output size, key count, and nesting depth at a glance.
paste a webhook payload and codefmt detects where it came from: Zapier, n8n, Pipedream, and HubSpot payloads are recognized automatically, and a banner generates the access code for reaching your fields inside that platform, ready to copy. if you're cleaning up the automation code around those payloads too, the Zapier code formatter and the n8n code formatter handle the code-step side.
everything above runs client-side: formatting is synchronous in your browser, nothing you paste is uploaded, and documents up to 5MB format without a server round trip.
if it changed, JavaScript's JSON.parse changed it. JSON.parse stores every number as a 64-bit float, and floats are only exact for integers up to 9,007,199,254,740,991 (2^53 - 1). a 19-digit id like 1144241312345678901 silently rounds to 1144241312345678800, and a decimal written as 1.10 comes back as 1.1. codefmt doesn't parse numbers into floats: it reprints each number's original digits straight from your source text, so ids and decimals survive formatting unchanged.
repair fixes six categories of almost-JSON: comments (// and /* */), trailing commas, single-quoted strings, unquoted object keys, the Python literals True, False, and None (rewritten to true, false, and null), and JavaScript's undefined (rewritten to null). it also strips a leading byte-order mark and notes it. repair is opt-in and off by default because it rewrites your input. when it runs, a notice above the output lists exactly what changed, for example: repaired: 2 trailing commas, 1 unquoted key.
no. formatting, repair, tree view, and payload detection all run in your browser; nothing you paste leaves the page. that makes it safe for webhook payloads that contain api keys, tokens, or customer data. documents up to 5MB format instantly; past that limit formatting pauses so the page stays responsive.
because your input had two. codefmt formats from the raw tokens of your document, so duplicate keys are preserved exactly as written. a JSON.parse round trip keeps only the last value for any repeated key, which hides the duplicate instead of showing it. preserving duplicates means the formatted output matches the document you pasted, mistakes included, and a duplicate key is usually a mistake worth seeing.
paste it. the parser reports the exact line and column of the first problem, draws an inline squiggle under it in the editor, and the error banner's go to error button jumps your cursor straight to the spot. if the input looks repairable, the same banner offers a one-click enable repair action.
yes. the indent control offers 2-space, 4-space, tab, and minify output. minify strips all insignificant whitespace, which is useful for embedding JSON in an environment variable or a query string. you can also sort keys alphabetically, and the text or tree toggle switches the output pane between a code view with line numbers and an expandable tree with copy path and copy value on every node.