JSON to Go
Paste or drop your data here, or open a file.
New to Bracely?
Everything stays in your browser.
Output appears here
Paste or open your data in the input box. It never leaves your browser.
JSON to Go
Paste a JSON sample, such as an API response, and Bracely writes Go structs with json tags for it. Each object becomes a struct with `json:"..."` tags, and fields that are missing from some items become pointers with omitempty. List any other fields in Omit when empty, comma separated, to add omitempty to them too.
How do I use the JSON to Go?
- Paste a JSON sample.
- Set the root type name, for example Order.
- Copy the Go code into your project.
What does the JSON to Go do?
- Struct tags that keep the original key names
- int64 and float64 picked from your numbers
- Optional fields as pointers
- Nested objects become their own named types
- 20 other languages from the same sample, including TypeScript
Frequently asked questions
- How does it pick Go types?
- From the values in your sample: whole numbers, decimals, text, true/false, arrays and nested objects. When array items disagree, the field is made optional or widened.
- Can I generate other languages?
- Yes. Change Language to any of the others: TypeScript, Python, Pydantic, Java, C#, Kotlin, Swift, Rust, Scala, Ruby, Dart, PHP, Zod, TypeBox, Valibot, Yup, GraphQL, Protobuf, Prisma and Drizzle.
- Is my data uploaded?
- No. Bracely runs entirely in your browser, so nothing you paste or open leaves your device.
More JSON tools
Bracely has 108 JSON tools in one page. Related ones:
- JSON to Java
- JSON to C#
- JSON to Python
- JSON to Kotlin
- JSON to Swift
- JSON to Dart
- JSON to Rust
- JSON to PHP
- JSON to Zod
- JSON to GraphQL
- JSON to Protobuf
- JSON to Pydantic
- JSON to TypeBox
- JSON to Valibot
- XML to JSON
- JSON to TOML
- Password generator
- Mock JSON generator
- SQL formatter
- HTML formatter
- JSON Formatter
- JSON Validator
- JSON Viewer
- JSON Repair
- JSON Diff
- JSON to YAML
- JSON to CSV
- jq Playground
Runs entirely in your browser. Nothing you paste is uploaded. Made by Saurabh Pagrut · About · Privacy policy
Last updated · Version 6.7 · Changelog
Saurabh Pagrut on GitHub · LinkedIn · X · YouTube · Instagram