Card design

How to Edit Anki Card Templates Without Breaking Your Cards

Edit Anki front, back, and styling templates safely with a cloned note type, field replacements, conditional sections, previews, and a five-note test.

Editing an Anki card template changes how every card of that type presents its stored fields. The safe workflow is to clone the note type, edit the front, back, and shared styling in Anki Desktop, preview several kinds of notes, and complete real reviews before moving a large collection.

Start with a small structural change. Do not paste an unfamiliar theme, rename fields, add card types, and reorganize the answer on the same attempt. Each operation has a different failure mode, and a narrow edit is much easier to verify or reverse.

Protect existing cards before editing

First identify the scope. A note stores fields such as Sentence, Meaning, and Audio. A card type supplies the front and back templates used to generate cards from those notes. A note type contains the field definitions and one or more card types.

That means a saved template change is not limited to the note currently open. It changes the presentation of existing cards generated by that card type. The Anki card-template manual explains that templates control both what appears on each side and, in some cases, which cards are generated.

Before a meaningful edit:

  1. Sync Anki so another device is not holding newer collection changes.
  2. Export a backup if the collection is important or the edit is extensive.
  3. Open Tools → Manage Note Types in Anki Desktop.
  4. Select the note type and use Add → Clone.
  5. Give the clone a specific name, such as Language — Reading v2.
  6. Change a few test notes to the clone instead of converting the whole collection.

Cloning protects the current layout, but it does not replace verification. A clone can still produce extra cards, omit a required field, or contain media references that fail on another device.

If you are still deciding which information belongs in the note, use the Anki card fields guide first. Templates should arrange stable fields, not compensate for a Front field containing an entire hand-formatted card.

Open Anki's card template editor

In Anki Desktop, open the editor for a note and choose Cards…. You can also use Tools → Manage Note Types, select a note type, and choose Cards. The editor provides three main panels:

PanelWhat it controls
Front TemplateThe question shown before you reveal the answer
Back TemplateThe answer and feedback shown after reveal
StylingCSS shared by the card types in that note type

The preview uses the current note when the Cards window is opened from an editor. When opened from Manage Note Types, Anki may show field names as placeholders. A preview is therefore evidence about one state, not proof that every note works.

Choose the card type you intend to edit when the note type generates more than one. A recognition card and a listening card can share fields and styling while using different front and back templates.

For a choice among recognition, listening, Cloze, and production layouts, start with the four language-learning Anki templates. This guide focuses on applying a chosen structure safely.

Edit the front template around one question

Anki templates use HTML plus field replacements. Text inside double curly brackets is replaced with the matching field value:

<div class="sentence">{{Sentence}}</div>

Field names are case-sensitive. {{Sentence}} and {{sentence}} are different references. The official field-replacement guide documents this syntax and the special replacements available in templates.

For a reading-recognition card, a focused front can be this small:

<main class="card-content">
  <p class="prompt">Understand this sentence</p>
  <div class="sentence">{{Sentence}}</div>
</main>

The front should make the retrieval job clear without exposing the answer. Common front-template mistakes include:

  • displaying Meaning or Translation before recall;
  • showing a screenshot that contains translated subtitles;
  • putting the transcript on an audio-first listening card;
  • adding several unrelated questions to one card; and
  • copying field content into the template as permanent text.

Static instructions such as “Understand this sentence” belong in the template. The sentence itself belongs in a field. This separation lets one template update many cards without erasing note-specific content.

Build the back as concise feedback

Anki's special {{FrontSide}} replacement repeats the rendered front on the answer side. A clear back can preserve the prompt and then add only the evidence needed to grade it:

{{FrontSide}}
<hr class="answer">

<main class="answer">
  <div class="meaning">{{Meaning}}</div>
  <div class="translation">{{Translation}}</div>
  <div class="audio">{{Audio}}</div>
  <div class="source">{{Source}}</div>
</main>

The divider makes the answer boundary visible. {{FrontSide}} does not replay front-side audio automatically; include the audio field on the back too when replay there is intentional, as the Anki field documentation notes.

Do not make the back a reference page by default. For a language sentence, it usually needs the contextual meaning, exact transcript or target, useful media, and recoverable source. Long grammar notes can remain in a separate optional field or link rather than pushing every answer below the fold.

Hide optional fields when they are empty

If Image, Notes, or Translation is optional, wrap the entire block in a conditional replacement:

{{#Image}}
  <div class="image">{{Image}}</div>
{{/Image}}

{{#Notes}}
  <aside class="notes">{{Notes}}</aside>
{{/Notes}}

Anki renders the block between {{#Field}} and {{/Field}} only when that field is not empty. This prevents empty headings, dividers, and spacing from appearing around missing content. Anki documents the behavior in its conditional replacement guide.

Put labels inside the conditional block:

{{#Source}}
  <div class="source">
    <span class="label">Source</span>
    {{Source}}
  </div>
{{/Source}}

If the label sits outside, “Source” still appears on notes with no source. Test both filled and empty versions of every optional field.

Conditional sections can also affect whether a normal card is generated. Do not use them to create a new card type until you understand the notes that qualify and the review workload that new cards add. The official card generation guide describes empty cards, selective generation, reverse cards, and Cloze-specific behavior.

Edit shared styling without hiding structure

Use the Styling panel for presentation shared across the note type. Start with readable, responsive CSS:

* {
  box-sizing: border-box;
}

.card {
  max-width: 42rem;
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 2.5rem);
  font-family: system-ui, sans-serif;
  font-size: clamp(18px, 2.4vw, 22px);
  line-height: 1.6;
  text-align: left;
  overflow-wrap: anywhere;
}

.sentence {
  font-size: 1.4em;
}

img {
  max-width: 100%;
  max-height: 45vh;
}

.source {
  margin-top: 1.5rem;
  font-size: 0.75em;
  opacity: 0.72;
}

Changing a generic selector such as .card, img, or a can affect every card type sharing the styling. Use descriptive classes around fields so a targeted change does not accidentally restyle the whole answer.

Avoid fixed phone widths, remote font dependencies, and JavaScript used only for decoration. Current Anki clients can differ in their rendering environment, so standard HTML, native field replacements, and responsive CSS are the durable baseline. The Anki styling manual covers platform-specific classes, fonts, images, and night mode. The mobile-friendly Anki CSS guide provides a fuller copyable stylesheet and writing-system checks.

Use a five-note test before scaling

Previewing the note already open can miss the exact conditions that break a template. Put five representative notes on the cloned note type:

  1. Minimum: only the required prompt and answer fields.
  2. Complete: every optional field filled.
  3. Media: real audio plus portrait and landscape images where relevant.
  4. Long content: a long sentence, source URL, and multi-line note.
  5. Writing-system stress case: accents, combining marks, furigana, or right-to-left text used by the deck.

For each note:

  • preview the front and back;
  • confirm the answer is not visible on the front;
  • confirm empty optional blocks disappear;
  • complete one real review;
  • replay audio after revealing the answer;
  • test day and night modes;
  • sync, then review on the mobile client you actually use; and
  • confirm the number of generated cards matches your intention.

A real review matters because previews do not reproduce every interaction. Typed answers are a good example: input and comparison behavior should be tested in review, not inferred from one preview. See the Anki type-in-the-answer setup when exact input is part of the card.

After the five notes pass, move a small batch to the cloned note type and review normally for several days. Convert the rest only when the template remains readable and the card count is correct.

VidToAnki is currently a private beta that works from permitted MP4 input toward structured, import-ready Anki deck material. Whether a deck is generated or made manually, template inspection stays a human quality check: import a small sample, verify the fields and media, and edit the Anki note type only when the retrieval task needs it.

Troubleshoot common template errors

SymptomLikely causeCheck
“Field not found” warningName or capitalization does not matchCompare the replacement with Fields exactly
Blank front or backRequired field is empty or the template references the wrong fieldTest a fully populated note and inspect both panels
Empty label or divider remainsLabel sits outside a conditional blockWrap label, field, and spacing together
More cards appear than expectedAnother card type or deletion number generates siblingsInspect every card type and the browser's card count
Audio plays on the front but not the back{{FrontSide}} does not replay itAdd the audio field to the back when replay is desired
Layout breaks on mobileFixed width, large media, or unavailable fontUse responsive CSS and test the actual client
A change affects unrelated cardsThey share the same note type or stylingRestore the clone and narrow the selector or scope

When a card renders blank, do not immediately delete the note. First check whether the stored information is intact in the editor. A template can hide usable fields without removing their data.

Anki template editor FAQ

Where is the card template editor in Anki?

In Anki Desktop, open a note and choose Cards…, or use Tools → Manage Note Types, select the note type, and choose Cards. Edit Front Template, Back Template, and Styling there.

Does editing an Anki template change existing cards?

Yes. The saved template belongs to the note type, so existing cards of that card type use the change. Clone the note type and test representative notes first.

Why does Anki say a field is not found?

Field names are case-sensitive. Match the spelling, spaces, and capitalization in Fields, and confirm the note uses the note type you are editing.

Can I edit Anki card templates on mobile?

Use Anki Desktop for note-type and template changes. Then sync and test on your mobile client because font availability, screen size, media, and controls can still expose layout problems.

Card design

Anki Type in the Answer for Language Learning

Set up Anki type-in-the-answer cards for spelling, inflections, and Cloze prompts, with copyable templates, comparison behavior, and mobile checks.

Read article →