Go Struct to JSON Schema Generator

Need JSON to Go?

Convert JSON data to Go code

JSON → Go Structs

Go code Input

Loading...

JSON Schema Output

Paste your Go structs to produce JSON Schema instantly.

Supports struct tags, slices, maps, embedded structs, and pointer fields.

Frequently Asked Questions

What Go syntax is supported?

The parser reads type declarations for structs, including exported/unexported fields, slices, arrays, maps, pointers, embedded structs, and tags such as `json:"name,omitempty"`. Fields tagged with `json:"-"` are skipped automatically.

How are Go types mapped to JSON Schema?

Primitive types (string, bool, int/uint sizes, floats, time.Time, etc.) are mapped directly to JSON Schema primitives. Slices and arrays become schema arrays, maps become objects with additionalProperties, and pointer types are treated as optional fields.

Does it run locally?

Yes. Conversion happens entirely inside your browser. Paste private structs or DTOs without leaving your machine. The tool infers schema without calling any backend services.

How do I generate mock JSON?

After you generate the schema, click "Generate Mock Data" to open the Mock Generator with the schema preloaded. Configure locales, array counts, and optional fields to create sample payloads instantly.