Step-by-step
🎓 Hugging Face
Hugging Face
📘 Step-by-step 📘 Hugging Face↗ Hugging Face · Official sitebeginner 🏠 Everyday life

Build a personal study-buddy flashcard page in 15 minutes with Hugging Face Spaces

Make your own flashcard quiz page on a free Static Space: paste one ready-made file, swap in your own questions, and practice until you know every card.

This guide was written by AI. It passed automated fact and quality checks, and our editor spot-checks published guides every day.

See AI World HQ first on GoogleAdd us as a preferred source and our stories show up higher in Google’s Top Stories.Add on Google

Flashcards work best when you test yourself instead of just rereading notes. This guide gives you a small quiz page you can open on any device with a browser. To be clear about what it is: it's a simple page that runs your own cards. It doesn't use an AI model, and it doesn't make up questions for you, so every answer it shows is one you wrote.

💡 Tip: tap a step’s number when you finish it — a green tick appears and your browser remembers how far you got.

✅ Before you start
  • A Hugging Face account. Sign up at huggingface.co if you don't have one.
  • Know what's free. Hugging Face's docs say Static Spaces are free for everyone and never need a paid plan. (Gradio and Docker Spaces, which run on compute, need a paid plan to create, so this guide uses a Static Space.)
  • A few questions you want to learn, each with a short answer.
  • About 15 minutes. You won't write code yourself: you'll copy one file and change only the question and answer text.
1
Step 1 of 5

Create a new Space

Go to huggingface.co/spaces and click Create new Space (or open huggingface.co/new-space directly). Fill in the form:

  • Name: something short, such as my-study-buddy. It becomes part of your Space's address.
  • License: optional. You can leave it empty.
  • SDK: choose the static HTML option.
  • Visibility: Public lets anyone with the link open your page. Private keeps the page and its files visible only to you (other people get a "404" error). Hugging Face notes that Protected is part of paid plans.

Then create the Space.

✅ You'll know it worked when

you're taken to your new Space's page, with tabs such as Files.

Next step ↓
Hugging FaceCreate new Spa…
✏️ Sketch — your screen may look a little different
2
Step 2 of 5

Add the quiz file

Hugging Face's docs say a Static Space serves the HTML in a file called index.html. To add it in your browser, open the Files tab and click Add file, then choose to create a new file. Name it index.html.

If an index.html file is already listed in your Space, open that file and replace everything in it instead.

✅ You'll know it worked when

you see an editor where you can name the file and type its content.

Next step ↓
Hugging FaceFiles
✏️ Sketch — your screen may look a little different
3
Step 3 of 5

Paste the ready-made code

Copy this whole block and paste it into the file:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My Study Buddy</title>
<style>
 body { font-family: system-ui, sans-serif; max-width: 560px; margin: 40px auto; padding: 0 16px; }
 #card { border: 2px solid #ccc; border-radius: 12px; padding: 24px; min-height: 120px; }
 #answer { margin-top: 16px; }
 button { font-size: 16px; padding: 10px 16px; margin: 12px 8px 0 0; cursor: pointer; }
</style>
</head>
<body>
<h2>📚 My Study Buddy</h2>
<p id="progress"></p>
<div id="card">
 <strong id="question"></strong>
 <div id="answer" hidden></div>
</div>
<button id="show">Show answer</button>
<button id="knew" hidden>I knew it</button>
<button id="again" hidden>Not yet</button>

<script>
// Your flashcards: ["question", "answer"]. Change, add, or delete lines.
const CARDS = [
 ["What do plants make during photosynthesis?", "Sugar and oxygen, using sunlight, water, and carbon dioxide."],
 ["What is the Spanish word for \"apple\"?", "la manzana"],
 ["What is 7 × 8?", "56"],
];

const queue = CARDS.slice();
for (let i = queue.length - 1; i > 0; i--) {
 const j = Math.floor(Math.random() * (i + 1));
 [queue[i], queue[j]] = [queue[j], queue[i]];
}
let known = 0;
const el = (id) => document.getElementById(id);

function showCard() {
 if (queue.length === 0) {
 el("question").textContent = "Done! You knew all " + CARDS.length + " cards. Reload the page to start again.";
 el("answer").hidden = true;
 el("show").hidden = el("knew").hidden = el("again").hidden = true;
 el("progress").textContent = "";
 return;
 }
 el("question").textContent = queue[0][0];
 el("answer").textContent = queue[0][1];
 el("answer").hidden = true;
 el("show").hidden = false;
 el("knew").hidden = el("again").hidden = true;
 el("progress").textContent = "Known: " + known + " / " + CARDS.length;
}

el("show").onclick = () => {
 el("answer").hidden = false;
 el("show").hidden = true;
 el("knew").hidden = el("again").hidden = false;
};
el("knew").onclick = () => { queue.shift(); known++; showCard(); };
el("again").onclick = () => { queue.push(queue.shift()); showCard(); };

showCard();
</script>
</body>
</html>

At the bottom of the editor, save the file to the main branch (you can add a short message, such as "Add quiz page"). Hugging Face's docs say your Space rebuilds and restarts automatically each time you save a change.

✅ You'll know it worked when

index.html appears in your Space's file list.

Next step ↓
Paste the ready-made code
4
Step 4 of 5

Try your flashcards

Open your Space's page (the App view). You'll see one question. Think of the answer, then click Show answer.

  • Click I knew it to remove the card from this round.
  • Click Not yet to send it to the back of the line. It will come back.

When every card is marked I knew it, the page says you're done. Reload the page to start a new round.

✅ You'll know it worked when

the counter at the top goes up each time you click I knew it.

Next step ↓
Hugging FaceApp
✏️ Sketch — your screen may look a little different
5
Step 5 of 5

Put in your own questions

Open index.html again from the Files tab and edit the lines between const CARDS = [ and ];. Each card is one line in this shape:

 ["Your question?", "Your answer"],

Keep the quotation marks, the comma between question and answer, and the comma at the end of the line. If your text needs a quotation mark inside it, put a backslash in front of it (\"), as in the "apple" example. Save the file again, and your Space updates.

💬 Example> ["What is the capital of Canada?", "Ottawa"],
✅ You'll know it worked when

your own questions show up after you reload the page.

Put in your own questions
⚠️ Common mistakes
  • The page is blank after an edit. A missing quotation mark or comma in a card line usually causes this. Compare your line with the shape in Step 5, or paste the original code again.
  • Others can't open your link. If your Space is private, only you can see it. You can change visibility later from your Space's Settings tab.
  • Expecting progress to be saved. The page doesn't remember results between visits. Reloading starts a new round.
  • Expecting it to write questions for you. It only shows the cards you typed. If you want help drafting questions, write them first with an AI assistant, check them yourself, then paste them in.
🚀 Try it now

Create the Space, paste the code, and replace the three sample cards with five questions from whatever you're studying this week. Then go through one round and see how many you knew on the first try.

🎯 Next guideBuild Your Own Text Summarizer with Hugging Face (No Code)Create a quick‑click summarizer on Hugging Face Spaces and turn long articles into bite‑size summaries without writing a single line of code.

❓ Quick questions

How long does this take?

About 6 minutes — the guide has 5 steps, and you can tick each one off as you go.

Which tool do I need?

This guide uses Hugging Face — but the approach works very similarly in other AI assistants.

Do I need to prepare anything?
  • A Hugging Face account. Sign up at huggingface.co if you don't have one.
  • Know what's free. Hugging Face's docs say Static Spaces are free for everyone and never need a paid plan. (Gradio and Docker Spaces, which run on compute, need a paid plan to create, so this guide uses a Static Space.)
  • A few questions you want to learn, each with a short answer.
  • About 15 minutes. You won't write code yourself: you'll copy one file and change only the question and answer text.
What mistakes should I avoid?
  • The page is blank after an edit. A missing quotation mark or comma in a card line usually causes this. Compare your line with the shape in Step 5, or paste the original code again.
  • Others can't open your link. If your Space is private, only you can see it. You can change visibility later from your Space's Settings tab.
  • Expecting progress to be saved. The page doesn't remember results between visits. Reloading starts a new round.
  • Expecting it to write questions for you. It only shows the cards you typed. If you want help drafting questions, write them first with an AI assistant, check them yourself, then paste them in.

Keep reading

📬 The week’s AI, in your inbox

One friendly email every Sunday — the 5 stories that mattered, in plain English. No spam, unsubscribe anytime.

Was this helpful?

✦ Generated by AI in AI World HQ's automated newsroom, written in plain language. Checked by automated fact and quality gates, and our editor spot-checks published guides every day. Spot a mistake? Use the buttons above.

📘 Prefer it in one file? First Steps with AI: The Beginner Pack (30 guides, free printable PDF)

← Back to all stories