How to Change Line Spacing in Anki

How to Change Line Spacing in Anki

Anki's default line height is already 1.5. Still, if a card with a multi-line explanation feels cramped, try raising it to 1.6–1.7. That said, shared decks and older note types sometimes have no line-height setting at all — in that case, the browser's default kicks in and things clearly look cramped. Checking which one your template has comes first.

What Is Anki's Default Line Height?

Anki's built-in note types (Basic, Basic (type in the answer), Cloze) have line-height: 1.5 in their styling. That means the line spacing is 1.5 times the font size.

The catch is that not every template has this setting. Note types from shared decks or templates made a while ago often lack line-height entirely, in which case the browser's default applies. In most browsers that's roughly 1.2 times the font size, which makes the same text look noticeably tighter.

You can check which one your template has right in ankieditor. Click an empty area to select the whole card, and look at the Line height field under "Text Style." 1.5 means Anki's default is set; if it shows 1.4, your template has no line-height setting (that's just the placeholder value the editor shows when there's none).

When Should You Raise It Above 1.5?

The length of the text on the card is what decides this.

  • A single word, one line of meaning — leave it at 1.5. With only one line, line height isn't even visible.
  • A two-to-three-line explanation or example — 1.6–1.7. Lines separate clearly, making them easier to skim.
  • Long prose with multiple paragraphs — 1.7. Though adding space between paragraphs works better than raising line height further.

These values are recommended starting points too, not measured optimums. The same value can look different depending on font and font size, so check the preview.

How to Change Line Height in ankieditor

  1. Click the part of the card you want to change in the preview to select it. Clicking empty space targets the whole card instead.
  2. Drag the Line height slider under "Text Style" in the left panel, or type a number into the box next to it. It adjusts from 1 to 3 in steps of 0.1.
  3. To widen spacing on just the example sentence field, click that field to select it, then change it the same way.
  4. Use [Copy Code] to copy the updated code and paste it into Anki's Tools → Manage Note Types → Cards... screen.

How Line Height Gets Written to Your CSS

Changing the whole card updates the .card rule in the styling area.

.card { line-height: 1.6; }

Changing just one field makes ankieditor issue a class named after that field and write the rule there.

.card { line-height: 1.5; }
.Example { line-height: 1.7; }

A number with no unit is a multiplier on the font size. Since the ratio holds even if you change the font size later, writing it unitless like 1.6 is safer than a fixed value like 24px.

Common Line-Height Mistakes

Going past 2.0 actually hurts readability. When lines get too far apart, a paragraph stops reading as one block and the lines look scattered instead.

Line height is inherited downward. Set it on .card and every field inside changes together. To make one field different, select it and set it separately.

Set this separately for each note type. Card templates are stored in the card types that belong to a note type, so if you use several note types, you'll need to apply it to each one.

Want Space Between Fields, Not Longer Lines?

Line height controls the space between lines inside a paragraph. But sometimes the cramped feeling is coming from somewhere else — an example sentence sitting right up against the answer with no space between them. You want to check the answer when you flip the card and move on, but the example sentence catches your eye too, and it slows down the whole review. Raising line height doesn't fix this: it just makes both the answer and the example looser, while the gap between them stays exactly the same.

What you actually need is one blank line between pieces of information that don't belong together. Because the eye naturally reads things that are close together as one group, a bit of space alone is enough to signal "the answer ends here, and this is supplementary." In ankieditor, click an element in the preview to select it, and a "Space below" row appears under the selection. Click to add one blank line below that element each time, and to remove one — the current count is shown in between.

The trick is to use it sparingly. Add space between every single field and the separating effect disappears — the card just gets longer. Keep things that should read as one group close together (a word and its pronunciation), and only add space between things that should read as separate (an answer and an example sentence).

Frequently Asked Questions

What is Anki's default line height?

Anki's built-in note types have line-height: 1.5 in their styling. Shared decks or older templates sometimes lack this setting, though, in which case the browser's default applies, showing roughly 1.2 times the font size.

What should I raise line height to?

For cards with explanations longer than two or three lines, 1.6–1.7 is recommended. Past 2.0, lines start to scatter and stop reading as one paragraph. Since it's a starting point, adjust it while watching the preview.

I changed line height, but nothing changed.

That happens when the card has only one line. Line height is the gap between lines, so it's invisible on a single-line card. Put a two-or-three-line sentence into a field's sample value to see the difference.

If it's long lines making things feel cramped, see How to Change Card Width in Anki; for building priority with font size, see How to Change Font Size in Anki.