JSON to Go (Golang) Struct Converter
BeanTrans parses JSON and JSON5 into idiomatic Go structs with PascalCase exported fields and accurate json:"key" struct tags directly in your browser. Nested objects are extracted into clean companion structs with zero backend transmission.
Key Capabilities
- Generates exported Go field names with configurable json:"field_name" tags for encoding/json.
- Automatically splits nested JSON objects and array element schemas into separate Go struct definitions.
- Bi-directional AST engine lets you swap Go structs back to JSON, Protobuf, SQL DDL, or Rust in one click.
Type Mapping Reference
| Source | Target | Notes |
|---|---|---|
string | string | Go UTF-8 string |
integer | int / int64 | Maps via Number Type option |
decimal | float64 | Standard Go floating point |
boolean | bool | Native Go boolean |
array<T> | []T | Typed Go slice |
Frequently Asked Questions
How does BeanTrans format JSON keys into Go struct fields?
BeanTrans converts snake_case and camelCase keys into exported PascalCase Go field names while preserving the original JSON key inside json:"..." struct tags.
Can I disable Go json struct tags if I only need plain structs?
Yes. Open the bottom Config drawer and uncheck Generate json tags under the Go section.
Does it handle deeply nested JSON arrays and objects?
Yes. BeanTrans walks the full AST and extracts nested objects and array item structures into named companion structs automatically.