YAML to JavaScript Object Converter
Parse YAML and emit JavaScript object literals with optional const wrappers for configs and fixtures.
Convert YAML to JavaScript object literals
Paste or upload YAML and get JavaScript object syntax you can drop into Node, bundlers, or test fixtures.
Optional const wrapping keeps variable names consistent across projects.
Related: YAML to JSON Converter, JSON to JavaScript Object Converter, and YAML Validator.
Frequently Asked Questions
Does this preserve YAML types?
Numbers, booleans, strings, nested maps, and lists are emitted as JavaScript literals. Dates and custom tags follow js-yaml parsing rules.
Can I omit the const wrapper?
Yes. Turn off the wrap option to copy only the object literal, useful inside existing assignments or function arguments.
Is my data sent to a server?
No. Parsing and formatting run entirely in your browser.