Go Struct to TypeScript Interface Converter
BeanTrans parses Golang structs and their json struct tags into idiomatic TypeScript interfaces directly in browser memory—keeping Go backend APIs and TypeScript frontends in sync with zero server uploads.
Key Capabilities
- Reads Go struct field types, slices ([]T), pointers (*T), and json tags accurately.
- Instant side-by-side preview ideal for Go (Gin/Fiber/Echo) + React/Vue API development.
- Supports swapping back to Go or targeting Java, Rust, Protobuf, and SQL DDL.
Type Mapping Reference
| Source | Target | Notes |
|---|---|---|
string | string | Go string to TS string |
int / int64 / float64 | number | Go numeric types to TS number |
bool | boolean | Go bool to TS boolean |
[]T | T[] | Go slice to TS array |
Frequently Asked Questions
Does BeanTrans respect json tags when converting Go structs to TypeScript?
Yes. The Go AST parser extracts json tag names when present so your TypeScript interface matches the actual JSON API payload.
Can I convert Go structs into Protobuf or JSON examples?
Yes. Keep your Go struct in the left Input panel and switch the Target dropdown to Protobuf, JSON, Rust, Java, Python, Kotlin, or SQL DDL.
Is any Go code sent over the network?
No. BeanTrans executes 100% locally inside your browser.