Skip to content
StringToJSON

About

A single-purpose tool that stays out of your way.

StringToJSONOnline exists for one recurring annoyance: you have a string that contains JSON, and you need the JSON. It happens with log lines, webhook bodies, message-queue payloads, database columns, and any API that decided to nest one serialization inside another.

How it works

The whole tool is a static page plus a few kilobytes of JavaScript. Conversion uses the browser's native JSON.parse and JSON.stringify — no parser of our own, no dependency to fall behind the spec, and identical behaviour to whatever your application will do with the same input.

The one piece of real logic is unwrapping. If a parse succeeds but yields another string that itself looks like JSON, it is parsed again, up to eight levels deep. If the input does not parse at all, it is wrapped in quotes and retried, which handles bare escaped bodies pasted without their surrounding literal.

No backend, on purpose

There is no server to send your payload to. That is not a privacy policy you have to trust — it is a property of the page. Open your network tab while you convert something; you will see no requests. Turn off your Wi-Fi; the tool keeps working.

The practical consequence is that you can paste production data, tokens included, without thinking about it. Read the privacy page for the specifics of what is and is not stored.

What it deliberately does not do

  • Accounts, history, sharing. Anything that would require a server.
  • JSON5 / JSONC. Comments and trailing commas are not JSON; supporting them quietly would teach the wrong thing.
  • Schema validation. Syntax only. Use Ajv or a schema playground for shape.
  • Ads and interstitials. The tool should load and be usable in under a second.

Where the leniency stops

Being forgiving about input is useful right up to the point where it starts lying to you. A converter that quietly accepts single quotes and trailing commas teaches you that your payload is fine, and then your actual parser rejects it in production.

So the rule here is narrow: leniency is allowed only where the input is unambiguouslyencoded JSON — a quoted literal, a bare escaped body, several layers of stringification. Those all have exactly one sensible interpretation. Anything that is merely invalid JSON is reported as invalid, with the line and column, even though guessing would often produce something plausible. Guessing is how you ship a bug.

Performance

Each page is static HTML with roughly eight kilobytes of JavaScript and no framework runtime, no webfonts and no third-party requests. That is not minimalism for its own sake — a utility you reach for twenty times a day should be usable before you have finished tabbing to it, and every dependency added is a request that has to resolve before that happens.

Feedback

Found a payload it handles badly? That is the useful kind of bug report — the parser's leniency rules are only as good as the real-world inputs they have seen. The same goes for a language guide that gets an idiom wrong or recommends something that stopped being current two versions ago. Email frontendedy@gmail.com, or use thecontact page.