---
title: "Nested tags for Markdown notes"
author: Pedro Thomaz
source: https://coffeetext.app/blog/nested-tags-markdown-notes
---

# Nested tags for Markdown notes

> Checked November 2026 against [Obsidian's help on tags](https://obsidian.md/help/tags). Coffee isn't affiliated with Obsidian or Bear.

A tag says what a note is about. A nested tag says it more precisely: `#work/acme` is about work, and within work, about Acme. Obsidian and Bear both read tags like this, and since they're just text in a Markdown file, they keep working whichever app opens the note next.

Here's how they work, when nesting is worth it, and how Coffee shows them.

## Two ways to tag a note

**In the text.** Write `#meeting` anywhere in a note. It's quick, and it can sit right next to the line it's about.

**In front matter.** A block at the top of the file, between two `---` lines:

```yaml
---
tags: [work, planning]
---
```

Front matter keeps tags out of the writing and is easy for scripts to read. More in [what front matter is](https://coffeetext.app/blog/what-is-front-matter). Coffee reads both, and a note can use both: the tags are put together, each once whatever its capitals.

## Nesting with a slash

A slash puts one tag inside another:

- `#work/acme` and `#work/beta` both sit under `work`.
- `#study/physics` sits under `study`.
- Deeper works too, as in `#work/acme/invoices`, though two levels is usually plenty.

Choosing a parent shows everything inside it. In Coffee, picking `work` in the sidebar lists notes tagged `work`, `work/acme` and `work/beta`. Picking `work/acme` lists only those.

## What isn't a tag

Coffee follows the rules most apps share, so `#` in ordinary writing doesn't turn into tags by accident:

- `# Heading` is a heading: the space after `#` makes it one.
- `#42` is a number, as in an issue. A tag needs at least one letter.
- `page.html#section` is the end of a link. A tag starts a word.
- Anything inside `` `code` `` or a code block stays code.

Tags can use letters from any language, numbers, `_`, `-` and `/`.

## When to nest, and when not to

Nest when a tag has grown big enough that you want to split it. `#work` with three hundred notes is hard to use, and `#work/acme`, `#work/beta` and `#work/admin` aren't. Choosing `work` still shows them all, so nothing is lost.

Don't nest to recreate your folders. If every note's tag repeats its folder, one of the two is doing nothing. Folders say where a note lives, tags say what it's about, as in [folders or tags](https://coffeetext.app/blog/folders-or-tags-markdown-notes).

## Tags in Coffee

- **The sidebar shows a tree.** Under Tags, nested tags sit indented under their parent, and a parent appears even if no note uses it on its own.
- **Tags are coloured in the text**, so `#work/acme` stands out from the sentence around it. Each tag keeps its colour everywhere.
- **Tags… in the Note menu** adds or removes front matter tags for you, writing the block if the note doesn't have one yet.
- **The graph** groups notes by folder, and tags let you cut across folders, which is why both are worth having. See [the graph view](https://coffeetext.app/blog/graph-view-markdown-notes-mac).

Everything stays in your files. A tag is the text you typed, so search, Git and any other Markdown app see exactly the same thing.

## Questions

### How do I make a nested tag?

Write the parent, a slash and the child: `#work/acme`. In front matter, `tags: [work/acme]` does the same.

### Does choosing a parent tag show the nested ones?

In Coffee, yes. Choosing `work` shows notes tagged `work`, `work/acme`, `work/beta` and so on.

### Are tags in the text and in front matter the same?

Coffee treats them as one set. A tag written either way shows under Tags in the sidebar.

### Why isn't #42 a tag?

A tag needs at least one letter, so issue numbers and the like stay as text.

Coffee is Mac only, with macOS 15 or later. It's free for 14 days without a card, then €3 a month, €29 a year, or €79 once with two years of updates.

---

Written by Pedro Thomaz, who makes Coffee, a Markdown editor for the Mac on macOS 15 or later. It's free for 14 days with no card or account, then €3 a month, €29 a year, or €79 once with two years of updates. More at https://coffeetext.app/llms-full.txt
