message: Hello worldPlain scalars are concise, but they can be misread when values look like booleans, dates, or special tokens.
Plain scalars, quoted strings, literal and folded blocks, and the quoting rules that prevent common YAML mistakes.
How plain, single-quoted, and double-quoted strings behave in YAML.
message: Hello worldPlain scalars are concise, but they can be misread when values look like booleans, dates, or special tokens.
Keep backslashes literal and avoid interpolation-like behavior.
path: 'C:\Users\jonathan
otes'Single quotes reduce escaping needs. To include a single quote, double it.
Use escapes like newline and tab in YAML strings.
message: "Line 1
Line 2"Double quotes support common escape sequences and are useful for values needing explicit escaping.
body: |
Thanks for your patience.
Please find attached the executed agreement.Literal blocks preserve newlines and are ideal for emails, certificates, Markdown, or shell scripts.
Wrap multi-line text into a single logical paragraph with `>`.
summary: >
ExpressYou helps people communicate with
more clarity, confidence, and connection.Folded blocks convert line breaks into spaces, which is useful for longer prose values.
Examples that prevent hard-to-debug YAML parsing surprises.
Avoid implicit booleans by quoting risky strings.
answer: "yes"
feature_flag: trueIn some parsers or older YAML variants, words like yes/no/on/off may be interpreted as booleans.
Prevent timestamps and date-like tokens from being auto-typed.
release: "2026-03-28"Quote values when you need them treated as strings instead of dates or timestamps.
yq '.app.name' app.yamlUseful in scripts and CI jobs that need one config value.
yq -i '.app.version = "1.2.0"' app.yamlA convenient way to bump versions or toggle config values automatically.