Terms of Service
About this tool
JSON to Go Struct is a free page that reads a JSON sample and writes Go type declarations for it, entirely inside the browser. Using the page means you accept these terms.
Your responsibility
Your data stays yours. Choosing a file or pasting text here gives no one permission to publish it, and you should only process material you are allowed to handle. The generated code is a starting point: compile it, review it and test it against real responses in your own project before you depend on it, and keep your own copy of the input.
Limits
Types are inferred from the one sample you provide and are not a runtime validator. Integer versus float is decided by how the value is written in the source text, so 1.0 becomes float64 and 1 becomes int64. A number outside the int64 range becomes float64 and may lose precision; a number outside the float64 range becomes json.Number and requires the encoding/json import. Empty arrays become []any, mixed arrays become []any, arrays of objects are merged into one struct with missing keys marked omitempty, and null becomes any or a pointer depending on the options. Keys that encoding/json cannot express in a tag name, such as a key containing a comma, are emitted with json:"-" and a comment, so those values are not decoded. Duplicate keys in one object are merged. A selected file larger than 16,000,000 bytes is rejected before it is read. Input is limited to 2,000,000 characters, 512 levels of nesting and 5,000 generated struct types; generation runs on the browser main thread and very large inputs may briefly block it. Only UTF-8 input is supported; downloads are UTF-8.
Privacy
Pasted JSON and selected files are processed locally as described in the Privacy Policy. Your original input is not changed.
Availability
The service is provided "as is" and "as available," without a guarantee of compatibility or uninterrupted operation. Nothing here limits rights that cannot lawfully be excluded.
Components
This tool uses only built-in browser features and includes no third-party runtime libraries.
Changes
Features and these terms may change; updated terms apply to later use.