---
title: "YAML syntax"
manual: "TYPO3 Explained"
version: "12.4"
permalink: "https://docs.typo3.org/permalink/t3coreapi:yaml-syntax@12.4"
source: "Configuration/Yaml/YamlSyntax.rst"
rendered: "2026-10-21T15:29:37+00:00"
---

> [!WARNING]
> **Attention**
>
> TYPO3 v12 has reached end-of-life as of April 30th 2026 and
> is no longer being maintained. Use the version switcher on the top
> left of this page to select documentation for a supported version of TYPO3.
>
> Need more time before upgrading?
> You can purchase Extended Long Term Support (ELTS) for TYPO3 v12 here:
> [TYPO3 ELTS](https://typo3.com/services/extended-support-elts).

# YAML syntax {#yaml-syntax}

Following is an introduction to the YAML syntax. If you are familiar with YAML, skip to
the **TYPO3 specific information**:

-   [YamlFileLoader](https://docs.typo3.org/permalink/t3coreapi:yamlfileloader@12.4)

> [!NOTE]
> **See also**
>
> A good general introduction to YAML syntax, basic data types, etc.:
>
> -   ["YAML Syntax" in Grav documentation](https://learn.getgrav.org/16/advanced/yaml)

The [TYPO3 coding guidelines for YAML](https://docs.typo3.org/permalink/t3coreapi:cgl-yaml@12.4) define some basic rules to
be used in the TYPO3 Core  and extensions. Additionally, YAML has general syntax rules.

These are recommendations that should be followed for TYPO3. We pointed out where things
might break badly if not followed, by using MUST.

-   File ending `.yaml`
-   Indenting with 2 spaces (not tabs). Spaces MUST be used. You MUST use the correct indenting level.
-   Use UTF-8
-   Enclose strings with single quotes (''). You MUST properly quote strings containing special
    characters (such as `@`) in YAML. In fact, generally using quotes for strings is encouraged.
    See [Symfony > The YAML Format > Strings](https://symfony.com/doc/current/components/yaml/yaml_format.html#strings)

> [!WARNING]
> **Attention**
>
> All text is case-sensitive.

To get a better understanding of YAML, you might want to compare YAML with PHP arrays:

**An array in PHP**

```php
$a = [
    'key1' => 'value',
    'key2' => [
        'key2_1' => 'value'
];

$b = [
    'apples',
    'oranges',
    'bananas'
];
```

YAML:

**The same array in YAML**

```yaml
# mapping (key / value pairs)
a:
  key1: 'value'
  key2:
    key2_1: 'value'

# sequence (list)
b:
  - 'apples'
  - 'oranges'
  - 'bananas'
```
