OpenReplay Logo
12k
12k

YAML to Go converter

Generate Go structs from YAML with typed fields and yaml tags, ready to paste into your codebase.

Processed locally

About this tool

Paste any YAML document and get an idiomatic Go struct with exported field names, inferred types and yaml struct tags — ready for yaml.Unmarshal.

Use it to bootstrap config loaders or API models without hand-writing boilerplate.

Field names are exported (capitalized, e.g. Name, Port) and types inferred from values: int, string, bool, float64.

Frequently asked questions

How are nested mappings handled?

Each nested mapping becomes its own named struct type, referenced from the parent.

What about lists?

Scalar lists become slices typed by their first element — []string, []int. A list of mappings generates a named element struct (merging keys seen across the items), referenced as []Item.

Which struct tags are emitted?

Every exported field carries a yaml tag (yaml:"field"), ready for yaml.Unmarshal — output is always yaml-tagged, with no toggle. If you need json-tagged structs instead, use the JSON to Go converter.