AiLounge Tools

Data Structure & Format Conversion

Infer TypeScript types or JSON Schema from a JSON sample, and round-trip JSON↔YAML over a controlled subset. Everything is computed locally in your browser; no document body is uploaded.Browser-only local processing · zero server API

Operations

Real examples and limits

Limits: 1 MiB of UTF-8 input, depth 64, 60000 nodes; violations return readable errors with line/column. The controlled YAML subset supports mappings, sequences, scalars, quoted strings, booleans and null only. Anchors &, aliases *, merge keys <<, tags such as !!binary, block scalars |/>, explicit document markers and multi-document streams are rejected. YAML 1.2-style dates remain strings, never Date objects. Numbers outside the IEEE-754 safe range or with high precision are preserved as raw decimal text with an explicit precision warning; losslessness is never claimed. A JSON sample is not a full type system: empty objects become Record<string, never> and empty arrays unknown[]. Related sites dev/diagram are planned configuration only; no live cross-site link is emitted before they launch.

FAQ

Is my input uploaded or persisted?

No. All three converters run in the page’s pure ESM module. The only network request is a same-origin GET of the public site.json config, with no request body. There is no server API, upload or eval; localStorage is not written by default; analytics is a no-op unless configured and its whitelist excludes document bodies.

Are large integers silently changed?

No silent changes: integers beyond Number.MAX_SAFE_INTEGER and high-precision numbers are kept as raw decimal text. A precision warning appears in output comments, result notes and warnings. TypeScript can only say number and JSON Schema integer; losslessness is never claimed.

Why are aliases, Date and binary tags unsupported?

Aliases and << merge keys can create exponential alias bombs, so they are rejected and never expanded. JSON has no Date type: date-like scalars stay strings and are quoted on output. Tags such as !!binary are rejected; encode binary as a quoted base64 string.

Can __proto__ / constructor pollute prototypes?

No. Every object built from user data uses Object.create(null) or a Map; special keys are written and serialized as ordinary own data keys. A fixed test vector explicitly asserts that global Object.prototype is unchanged.

Can I use the output with TypeScript / Schema validators?

TypeScript output is interface/type declarations; fields with special characters, reserved words or __proto__ are quoted. A Node 22 TypeScript syntax stripper parses fixed generated output in the tests. Schema output supports draft 2020-12 / draft-07 with $schema, type, properties, items, required and additionalProperties; mixed arrays use items.anyOf.