AI JS Object to JSON Schema Converter
Convert a JS object or JSON sample into an inferred JSON Schema (Draft 7 or 2020-12). Recursive type inference for string, number, boolean, null, array, object; nested objects and arrays; format detection (email, date-time, uri, uuid); enum inference; multi-sample merging with anyOf; optional-fields handling; constraint inference (minLength/maxLength/minimum/maximum); validate JSON against the inferred schema; Markdown/JSON export; history (localStorage); shareable URL; optional BYO-key LLM descriptions. 100% client-side — your data never leaves the browser.
About AI JS Object to JSON Schema Converter
Convert a JS object or JSON sample into an inferred JSON Schema (Draft 7 or 2020-12). Recursive type inference for string, number, boolean, null, array, object; nested objects and arrays; format detection (email, date-time, uri, uuid); enum inference; multi-sample merging with anyOf; optional-fields handling; constraint inference (minLength/maxLength/minimum/maximum); validate JSON against the inferred schema; Markdown/JSON export; history (localStorage); shareable URL; optional BYO-key LLM descriptions. 100% client-side — your data never leaves the browser. Everything runs locally in your browser — your data never leaves your device.
How to use
- Enter your input in the tool above.
- Adjust any options to your preference.
- Use the Copy or Download buttons to save the result.
- Everything happens locally — your data never leaves your browser.
FAQ
How does the JS object to JSON schema converter work?
Paste one or more JS objects / JSON samples and the tool recursively infers a JSON Schema: it walks each value, records its type (string, number, integer, boolean, null, array, object), detects common formats (email, date-time, date, uri, uuid), infers enum values for short string sets, and merges multiple samples into a single schema with anyOf for mixed types. You can switch between Draft 7 and Draft 2020-12 output, toggle enum/format/required detection, and validate other JSON against the result.
What JSON Schema drafts are supported?
Two: Draft 7 (default — uses '$schema': 'http://json-schema.org/draft-07/schema#') and Draft 2020-12 (uses '$schema': 'https://json-schema.org/draft/2020-12/schema'). The same inferred schema tree is rendered with the appropriate $schema header and minor keyword differences (e.g., Draft 7 'items' vs Draft 2020-12 'items' on arrays).
How are optional vs required fields handled when I paste multiple samples?
When you provide multiple samples, the tool unions the keys seen across all of them. A key is added to the 'required' array only if it appears in every sample (configurable). Keys present in some samples but not others become optional — they appear in 'properties' but are not in 'required'. Empty arrays are flagged with a note because their item schema cannot be inferred from zero elements.
What extra features does this tool have compared to others?
(1) Recursive type inference (7 JSON types). (2) Format detection (email, date-time, date, uri, uuid). (3) Enum inference for small string sets. (4) Multi-sample merging with anyOf for mixed types. (5) Required-field toggle (every-sample vs none). (6) Draft selector (Draft 7 vs 2020-12). (7) Constraint inference (minLength, maxLength, minimum, maximum, minItems, maxItems). (8) Validate-other-JSON tab. (9) Copy/download as .json. (10) Markdown documentation export. (11) History (localStorage, last 20). (12) Shareable URL with samples + options encoded. (13) Sample presets. (14) Optional BYO-key LLM to suggest field descriptions.
Is my data sent anywhere?
No. All type inference, format/enum detection, merging, validation, and export run locally in your browser. Your sample objects never leave this device. The only network call is if you paste your own LLM API key and click 'Suggest descriptions with LLM' — that request goes directly from your browser to the LLM provider you choose (OpenAI or Anthropic).
Related tools
AI .htaccess Redirect Generator
Generate Apache .htaccess redirect and rewrite rules from bulk old→new URL pairs or plain-language intent. Supports 301 permanent, 302 temporary, 307, RedirectMatch, RewriteRule with regex capture groups, www/non-www canonicalization, HTTP→HTTPS, hotlink protection, custom error pages, and IP allow/block. Per-rule explanations, sample-URL tester emulating mod_rewrite, and redirect-loop detection. Pure-JS engine — optional BYO-key LLM. 100% client-side, no upload.
AI Alt Text Generator for Images
Generate WCAG-friendly alt text for images. On-device metadata extractor (dimensions, format, dominant color, filename → suggest), context-aware descriptive templates, decorative vs informative vs complex classifier, length meter, 'don't start with image of' linter, optional SEO keyword weaving, 100+ language templates, batch CSV/JSON export, optional BYO-key LLM caption enhancement. 100% client-side — images never uploaded.
AI Analogies Generator
Explain any concept with tailored analogies across 10+ domains (cooking, sports, nature, technology, music, business, science, everyday life, kids, vehicles). Pure-JS analogy template engine with metaphor / simile / story styles, complexity levels, 'where it breaks down' honesty notes, explainer expansion, concept keyword extractor, audience presets, optional BYO-key LLM enhancement. 100% client-side — nothing uploaded.