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:
- Sync Anki so another device is not holding newer collection changes.
- Export a backup if the collection is important or the edit is extensive.
- Open Tools → Manage Note Types in Anki Desktop.
- Select the note type and use Add → Clone.
- Give the clone a specific name, such as
Language — Reading v2. - 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:
| Panel | What it controls |
|---|---|
| Front Template | The question shown before you reveal the answer |
| Back Template | The answer and feedback shown after reveal |
| Styling | CSS 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
MeaningorTranslationbefore 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:
- Minimum: only the required prompt and answer fields.
- Complete: every optional field filled.
- Media: real audio plus portrait and landscape images where relevant.
- Long content: a long sentence, source URL, and multi-line note.
- 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
| Symptom | Likely cause | Check |
|---|---|---|
| “Field not found” warning | Name or capitalization does not match | Compare the replacement with Fields exactly |
| Blank front or back | Required field is empty or the template references the wrong field | Test a fully populated note and inspect both panels |
| Empty label or divider remains | Label sits outside a conditional block | Wrap label, field, and spacing together |
| More cards appear than expected | Another card type or deletion number generates siblings | Inspect every card type and the browser's card count |
| Audio plays on the front but not the back | {{FrontSide}} does not replay it | Add the audio field to the back when replay is desired |
| Layout breaks on mobile | Fixed width, large media, or unavailable font | Use responsive CSS and test the actual client |
| A change affects unrelated cards | They share the same note type or styling | Restore 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.
Related guides
Anki Card Templates for Language Learning: 4 Copyable Layouts
Compare four copyable Anki card templates for language learning, choose by retrieval goal, install safely, and test HTML, CSS, media, and mobile layouts.
Read article →Anki Card Fields for Language Learning: A Clean Setup
Build reusable Anki note fields for sentence, focus, meaning, translation, audio, image, source, and notes without locking content into one layout.
Read article →Anki Card CSS for Language Learning: Mobile-Friendly Style
Copy a responsive Anki card CSS baseline for readable language cards, night mode, mobile media, right-to-left text, furigana, and typed answers.
Read article →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 →