Convert stringified JSON values back to real types
CSV importers, form posts and older APIs quote every scalar. Paste that JSON and get numbers, booleans and nulls back at every depth — with leading zeros, oversized integers and any keys you name left untouched.
About this tool
json-coerce-types is for already-valid JSON where every scalar was imported as text. It walks objects and arrays recursively and changes safe string values into native JSON types: "42" becomes 42, "true" becomes true, and "null" becomes null.
The defaults are deliberately conservative for production data cleaning. Numeric strings, booleans and "null" are enabled, but leading-zero values such as ZIP codes, account IDs and phone-like fields stay strings unless you choose "Coerce to numbers". Integers outside the 64-bit range also stay strings instead of being rounded through floating point.
Use skip_keys when certain field names must never be touched, or only_keys when you want to retype one branch such as counts or scores and leave the rest of the document exactly as strings. Switch the output to "Change report" to audit every path that would change before copying the retyped JSON.
Limits and edge cases
- Input must be valid JSON first. If the document has comments, trailing commas or unquoted keys, repair it before using this tool.
- The input cap is 5 MB.
- Object keys are never renamed or retyped; only string values can change.
- JSON has no date or BigInt type. Date-looking strings stay strings, and huge integers that would lose precision stay strings.
- Thousands separators are only accepted when the grouping is well-formed, such as
"1,234"or"1,234.5".
FAQ
Will this change ZIP codes, phone numbers or IDs?
Not by default when they contain redundant leading zeros. Values such as "02134", "007" and "0005" stay strings while leading_zeros is set to keep. For extra safety, add field names such as zip, phone or id to skip_keys so their whole subtree is copied through untouched.
Does this fix broken JSON?
No. This tool starts after parsing succeeds and only retypes string values inside a valid JSON document. If your input has comments, trailing commas, unquoted object keys or missing quotes, run a JSON repair or formatter first and then coerce the repaired document.
How do I see what changed before using the result?
Set output to report. The result becomes a plain-text audit such as $.age: "42" -> 42, including nested array paths like $.items[0].active. Switch back to json when the report looks safe.
Why did a number-looking string stay a string?
The parser only accepts strict JSON number shapes unless you enable the relevant option. "1,234" needs thousands, zero-padded strings need leading_zeros = coerce, and values such as "12px", "0x1f", ".5", "1.", "NaN" and "Infinity" are intentionally left alone.
Developer & Automation Access
Run it from the terminal
Same engine as this page, headless — via the gizza CLI:
gizza tool json-coerce-types '{"age": "42", "active": "true", "note": "null", "zip": "02134"}'New to the CLI? Get gizza →
Open it by URL
Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:
https://gizza.ai/tools/json-coerce-types/?input=%7B%22age%22%3A%20%2242%22%2C%20%22active%22%3A%20%22true%22%2C%20%22note%22%3A%20%22null%22%2C%20%22zip%22%3A%20%2202134%22%7D&numbers=true&booleans=true&nulls=true&bool_synonyms=true&null_tokens=NA%2CN%2FA%2C-%2Cnone&empty_strings=keep&trim=true&leading_zeros=keep&thousands=true&skip_keys=zip%2Cphone%2Cid&only_keys=counts%2Cscores&indent=2&output=jsonMachine-readable descriptor: tool.json — title + parameters JSON Schema for agents.
