---
title: h2
description: "Create a level-two heading."
---

# h2

Create a level-two heading.

## Syntax

```knap
{{ value | h2 }}
```

## Usage

- Each nonempty data line becomes a heading.
- For arrays and objects, including serialized collections from another filter, string values are formatted recursively while keys and non-string values are preserved.

## Example

```json title="Data"
{
  "title": "Introduction"
}
```

```knap title="Template"
{{ title | h2 }}
```

```md title="Output"
## Introduction
```

## Related filters

- [h1](/filters/h1)
- [h3](/filters/h3)
