Helm Template Functions Reference

All built-in Helm / Sprig template functions with signature and example.

Searchable Helm and Sprig template function reference covering string, dict, list, math, encoding and flow functions with signature and example. Build correct Helm chart templates fast.

What is the difference between Helm functions and Sprig functions?

Sprig is the upstream Go template function library that supplies most string, list, math and encoding helpers. Helm adds a handful of chart-specific functions on top, such as include, tpl, required, lookup and the Files object, which are not part of Sprig.

Helm template functions reference

Helm charts are Go templates rendered with the Sprig function library plus a few Helm-specific helpers. Knowing the exact function name, signature, and pipeline behavior is what separates a clean chart from one full of YAML indentation bugs. This reference lists the most-used functions grouped by category, each with its signature and a worked example.

Filter by name or category below, and try a couple of common functions live in the playground at the bottom.

How it works

Templates evaluate left to right, and the pipe operator | feeds the previous result as the last argument of the next function — so {{ .Values.x | default "y" | quote }} reads naturally. Functions fall into families: string (upper, trim, replace, printf), flow/defaults (default, required, ternary, coalesce), lists (first, last, append, uniq), dicts (get, set, hasKey, keys), math (add, mul, max), encoding (b64enc, toJson, toYaml), and Helm-only (include, tpl, required, lookup).

Indentation helpers matter most: indent N adds N spaces to every line; nindent N adds a leading newline first. They are almost always paired with include (which returns a string) rather than template (which writes to output and cannot be piped). tpl re-renders a string as a template against the current context, useful for values that themselves contain template syntax.

Tips and examples

Common patterns from real charts:

name: {{ .Values.name | default .Chart.Name | quote }}
data:
  config.yaml: |
{{ toYaml .Values.config | indent 4 }}
labels:
  {{- include "mychart.labels" . | nindent 2 }}
secret: {{ required "secretKey is required" .Values.secretKey | b64enc }}

Always quote strings, use nindent when embedding a block under a key, and reach for include over template whenever the result needs piping. The interactive playground lets you try upper, quote, default, b64enc, and repeat on your own input.