JSON To JSDoc
Generate JSDoc typedef annotations from JSON sample data with real-time browser-side conversion.
Generate JSDoc typedefs from JSON payloads
JSDoc helps JavaScript teams document object shapes without switching to TypeScript.
When you receive JSON from an API, webhook, or fixture, writing matching
@typedef and @property annotations by hand is slow and
easy to get wrong. This generator inspects your JSON sample and emits JSDoc blocks
you can paste above functions, modules, or API client helpers.
What this tool does
Paste JSON in the input panel. The converter walks nested objects and arrays, infers primitive and composite types, and outputs a JSDoc typedef with dotted property paths for nested fields. You can customize the typedef name to match your domain model before copying the result.
Configuration options
- Typedef Name: Rename the generated root typedef instead of using a generic label.
Common use cases
- Document REST API responses in plain JavaScript projects.
- Add lightweight type hints before migrating legacy code to TypeScript.
- Share expected payload shapes with frontend and backend teams.
- Bootstrap JSDoc blocks for SDK wrappers and fetch helpers.
Related tools
Need static TypeScript interfaces instead of JSDoc? Try the JSON to TypeScript POJO Generator or JSON to Flow Converter. For runtime validators, use the JSON to io-ts tool.
Frequently Asked Questions
Does my JSON leave the browser?
No. Conversion runs entirely in your browser. Your JSON is never uploaded to a server, which makes the tool safe for internal API samples and production-like fixtures.
What JSON shapes are supported?
The converter works with JSON objects and arrays. Nested objects produce dotted
property paths such as customer.name in the generated JSDoc block.
Can I rename the typedef?
Yes. Use the Typedef Name field to control the root @typedef label.
Property paths still reflect the keys found in your JSON sample.
Are optional fields supported?
The generator reflects keys present in your JSON sample. Fields missing from the
sample are not marked optional automatically. Add union types such as
string|undefined manually when you need optional properties.
How is this different from JSON to TypeScript?
This tool emits JSDoc comments for JavaScript projects. The JSON to TypeScript
POJO Generator creates TypeScript interfaces and type aliases for
.ts files instead of comment-based documentation.