How to convert helm chart values.yaml to json
- Step 1Get the chart's default values — Run
helm show values <chart> > values.yaml, or openvalues.yamlfrom a cloned chart. Drop the file (.yaml/.yml/.txt) or paste it. Make sure it is the values file, not atemplates/*.yamlfile. - Step 2Keep multi-doc off — A
values.yamlis a single YAML document, so leave Multi-document YAML (---) off. (Only Kubernetes manifest stacks need that toggle.) - Step 3Pick an indent — Minified produces a compact
valuesstring for Terraform'shelm_release. 2 or 4 spaces produce a readable object for review or for committing a JSON snapshot of the defaults. - Step 4Convert to JSON — Click Convert to JSON. Nested keys like
image.repository,service.port, andingress.hostsbecome nested JSON objects and arrays matching the values tree. - Step 5Validate or diff — Validate the JSON against the chart's
values.schema.jsonwith a JSON Schema validator, or convert your override file separately and run JSON Diff against the defaults to review exactly what changes. - Step 6Watch the coercion on version-like values — Unquoted
tag: 1.20becomes the number1.2(trailing zero lost). Image tags and chart versions should be quoted in the source (tag: "1.20") so they survive as strings.
Helm values vs Helm templates — what this tool accepts
The single most common mistake is pasting a template file. This tool converts data, not Go templates.
| Input | Accepted? | Why |
|---|---|---|
values.yaml (defaults) | Yes | Plain YAML data — converts cleanly |
| Environment override file | Yes | Plain YAML data — convert separately to diff against defaults |
helm get values <release> | Yes | Output is plain YAML data |
templates/deployment.yaml | No | Contains {{- if .Values.x }} Go template syntax — not valid YAML, parser rejects it |
values.schema.json | No | Already JSON; use it as the validation target, do not convert it |
Value coercion to watch in chart values
js-yaml 4.1.1 (YAML 1.2 core schema) types unquoted scalars automatically. Quote what must stay text.
| values.yaml | JSON out | Note |
|---|---|---|
tag: 1.20 | 1.2 (number) | Trailing zero lost — quote the tag |
tag: "1.20" | "1.20" | Quoted → preserved correctly |
repository: nginx | "nginx" | Plain string |
replicaCount: 3 | 3 (number) | Intended integer |
enabled: true | true (boolean) | Real boolean; yes/no would stay strings |
memory: 256Mi | "256Mi" | Quantity stays a string (the Mi suffix) |
storage: (empty) | null | Empty value becomes JSON null |
Cookbook
Real chart-values snippets and the JSON they produce. The headline workflow: convert defaults and overrides separately, then diff.
A values.yaml block to JSON
ExampleNested image/service/ingress blocks become nested JSON objects and arrays, matching the values tree a chart template reads.
Input (values.yaml):
image:
repository: nginx
tag: "1.25"
service:
type: ClusterIP
port: 80
ingress:
enabled: true
hosts:
- host: app.example.com
Output JSON (2-space):
{
"image": { "repository": "nginx", "tag": "1.25" },
"service": { "type": "ClusterIP", "port": 80 },
"ingress": { "enabled": true, "hosts": [ { "host": "app.example.com" } ] }
}Diff a production override against chart defaults
ExampleThe flagship workflow. Convert both files (separately), then drop both JSON outputs into JSON Diff to see exactly what production changes.
Step 1: convert values.yaml (defaults) → defaults.json
Step 2: convert values-prod.yaml (override) → prod.json
Step 3: JSON Diff(defaults.json, prod.json)
Diff result (illustrative):
~ replicaCount: 1 → 3
~ resources.limits.memory: 128Mi → 512Mi
+ ingress.tls: [ { secretName: app-tls } ]Unquoted version tag loses a zero
ExampleA classic chart-values trap. Always quote image tags and chart versions in the source YAML.
Input:
image:
tag: 1.20
Output JSON:
{ "image": { "tag": 1.2 } } // trailing zero gone
Fix the source:
tag: "1.20" → { "image": { "tag": "1.20" } }Shared resources block via an anchor is expanded
ExampleChart defaults often DRY up resource limits with an anchor. The converter dereferences it — no aliases remain in the JSON.
Input:
defaultResources: &res
limits: { cpu: 500m, memory: 256Mi }
api:
resources: *res
worker:
resources: *res
Output JSON (anchor resolved at every site):
{
"defaultResources": { "limits": { "cpu": "500m", "memory": "256Mi" } },
"api": { "resources": { "limits": { "cpu": "500m", "memory": "256Mi" } } },
"worker": { "resources": { "limits": { "cpu": "500m", "memory": "256Mi" } } }
}Pasting a template by mistake
ExampleWhat happens when you paste a Go-templated chart file instead of values.yaml — and how to spot it.
Input (templates/deployment.yaml — WRONG file):
replicas: {{ .Values.replicaCount }}
{{- if .Values.ingress.enabled }}
...
Result: parse error — the `{{ }}` and `{{- if }}` are not valid YAML.
Fix: convert values.yaml (the data file) instead, or render
the template with `helm template` first, then convert the output.Errors and edge cases
Real errors and silent failures sourced from each platform's own documentation. Match the wording to the row, fix what the row says to fix.
Pasting a Go-templated chart file
Parse errortemplates/*.yaml files contain {{ .Values.x }} and {{- if }} directives that are not valid YAML, so the parser rejects them with a syntax error. This tool converts values.yaml (data) only. Render templates with helm template first if you need the output as JSON.
Unquoted image tag like `1.20` or `1.0`
Precision changeAn unquoted tag: 1.20 is a float and serializes as 1.2; 1.0 becomes 1. Always quote image tags and chart versions (tag: "1.20") in the source so they stay exact strings. The converter cannot know your intent — it follows the YAML spec.
Quantity strings like `256Mi`, `500m`
PreservedKubernetes resource quantities carry suffixes (Mi, Gi, m), so they are unambiguously strings and round-trip unchanged. No quoting needed for these — only bare numeric versions are at risk of coercion.
Duplicate key in the values file
Duplicate key errorIf a values file accidentally defines the same key twice in one mapping (easy to do when merging two charts' defaults by hand), the parser throws duplicated mapping key with the line number. Resolve to a single value before converting.
Tab indentation copied from a doc
Tab errorValues pasted from a rendered web doc sometimes carry tabs. A tab in indentation throws tab characters must not be used in indentation. Re-indent with spaces — Helm would reject tabs too.
Empty override file
Undefined outputAn override file that is empty or only comments parses to undefined, producing the literal undefined instead of {}. If you want an empty-object override, write {} explicitly in the YAML.
`null` values used to remove a default
By designHelm treats a null value as a removal of a default key. In the JSON, key: (empty) or key: ~ both become null — exactly what you want to pass to a helm_release to clear a default. The converter preserves the null faithfully.
Very large numeric value (e.g. a byte count)
Precision lossIntegers beyond 2^53−1 lose precision through JavaScript's number type. A huge maxBytes value can shift. Quote such values in the source if they must stay exact.
Multi-document values with the toggle on
Array outputA values file is normally one document, but if you concatenated several with --- and turned the multi-doc toggle on, you get a JSON array — not a merged object. Helm merges values files; this tool does not. Convert and diff each separately instead.
File over the free 2 MB limit
Upgrade requiredFree tier caps input at 2 MB and one file at a time. Even large umbrella-chart values files are usually well under that. A genuinely huge generated values file needs Pro (100 MB).
Frequently asked questions
Can I paste my Helm chart templates here?
No. This tool converts values.yaml — the data file — not the templates. Template files with {{- if .Values.enabled }} Go-template directives are not valid YAML and the parser will reject them. If you need a rendered template as JSON, run helm template first, then convert the output.
How do I compare my override values to the chart defaults?
Convert values.yaml (the defaults) and your override file separately to JSON, then drop both into the JSON Diff tool. The diff shows exactly which keys your override adds, removes, or changes — far clearer than reading two YAML files side by side.
Why did my image `tag: 1.20` become `1.2`?
Unquoted 1.20 is parsed as a float, and a trailing zero is not significant in a number. Always quote image tags and chart versions in the source (tag: "1.20") so they remain strings and survive conversion exactly.
Will the JSON work with Terraform's `helm_release`?
Yes. Terraform's helm_release accepts a JSON-encoded values string. Convert your values file with Minified indent for a compact body, or pass the pretty JSON through Terraform's jsonencode/jsondecode as appropriate to your module.
Are anchors and merge keys resolved?
Yes. js-yaml dereferences anchors (&name / *name) and merge keys (<<: *name) during parsing, so the JSON is fully expanded with no aliases. This matches how Helm itself sees the values after YAML parsing.
Can it validate against my chart's values.schema.json?
Not directly — this tool only converts. Convert the values to JSON here, then run that JSON through a JSON Schema validator using your chart's values.schema.json as the schema. The JSON Validator covers structural checks.
Are registry credentials in my values file uploaded?
No. Parsing runs entirely in your browser with js-yaml. Image-registry credentials, TLS secret references, and cluster endpoints in the values file stay on your machine — nothing reaches JAD Apps servers.
Does it merge multiple values files like Helm does?
No. Helm deep-merges values files in order. This tool converts one file at a time. If you turn the multi-doc toggle on for a concatenated file you get a JSON array, not a merged object. Convert each file and merge in your own tooling, or diff them.
How are `null` values handled?
An empty value (key:) or key: ~ both become JSON null. That is useful for Helm overrides, where a null clears a chart default — the converted JSON carries the null through faithfully so the override behaves as intended.
Does deeply nested config get truncated?
No. There is no depth limit — resources.limits, affinity.nodeAffinity.requiredDuringScheduling…, and other deep blocks convert in full. The only practical ceiling is the 2 MB free-tier file size (100 MB on Pro).
Can I convert the JSON back to a values.yaml?
Yes, with the inverse JSON to YAML tool. If you generate or template values as JSON, convert them to YAML to commit as a values-*.yaml override file.
How do I flatten nested values for a `--set` style list?
Convert to JSON here, then run it through the JSON Flattener to get dotted paths like image.repository and ingress.hosts[0].host — close to the --set key=value form Helm uses on the command line.
Privacy first
Conversion runs locally in your browser. No file is uploaded — only metadata counters are saved for signed-in dashboard stats.