JSON → Python TypedDict

Client

Paste JSON to get TypedDict scaffolding with inferred property types—handy for typing json.loads results or editor hints.

Learn more: JSON and Python

Emit `typing.TypedDict` classes that mirror the sample object—starter shapes for `json.loads` pipelines or editor tooling.

Keys and types

Property names use camelCase when they are valid Python identifiers; otherwise they fall back to snake_case. Numbers map to floats by default; tighten to `int` or `Decimal` when your API guarantees them. One example does not capture every optional field—use `typing.NotRequired` or `TypedDict(..., total=False)` once you know the contract.

JSON → Python

?

Parses JSON in your browser and emits classes inferred from the sample shape. Nested objects become nested types; arrays use the first element only to guess item shape. Nothing is uploaded.

Keys follow valid Python identifiers (camelCase or snake_case); tighten floats to int where your API guarantees integers.

Common use cases

  • Sketch TypedDicts for json.loads() results when you only have sample payloads.
  • Document internal RPC or task payloads before wiring pydantic or dataclasses.
  • Compare inferred shapes across environments to spot drifting keys.

Common mistakes to avoid

  • Expecting TypedDict to enforce runtime validation

    TypedDict is static typing. For runtime checks, use pydantic models or validators—this generator only suggests structure.

  • Missing unions when fields vary by type

    If a key is sometimes a string and sometimes an object, merge samples or model Union types manually.

FAQ

Is code generation local?

Yes. Parsing and emission happen entirely in your browser tab.

Does this emit dataclasses?

It targets TypedDict-style typing. Convert or wrap if your project prefers dataclass or pydantic classes.

Related utilities you can open in another tab—mostly client-side.