Skip to content

Qualitative coding: inductive vs deductive coding, with a codebook example

Qualitative coding is the process of assigning short labels, called codes, to segments of text such as survey answers or interview transcripts, so they can be counted and compared. In inductive coding the codes emerge from the data; in deductive coding you apply a predefined codebook. Most projects combine both, then group codes into themes.

John Sevec
John Sevec

SVP, Client Strategy · Updated August 14, 2026

Part of the guide Thematic analysis

You have 800 answers to “Why did you cancel?” and a meeting on Friday. Qualitative coding turns that pile of text into counts you can compare by segment, while keeping the quotes that explain them. It is the core step in thematic analysis, the wider method of finding patterns in qualitative data. This guide covers inductive and deductive coding, a codebook template, a worked example and intercoder agreement.

Key takeaways

  • Qualitative coding labels segments of text with short codes so you can count, compare and quote them.
  • Inductive coding builds codes from the data; deductive coding applies a codebook written in advance. Most projects use a hybrid.
  • A good codebook gives each code a name, a definition, include and exclude rules and an example quote.
  • One response can carry several codes, so code percentages can add up to more than 100%.
  • Check intercoder agreement on a sample before coding everything.

What is the difference between inductive and deductive coding?

The difference is where the codes come from. In inductive coding, you read the data with no list in hand and create codes as ideas appear. In deductive coding, you start from a predefined codebook, often based on earlier research. A hybrid approach starts with a short codebook and adds codes when the data shows something it misses.

Inductive coding Deductive coding Hybrid
Starting point The data A predefined codebook A short codebook, open to additions
Best when The topic is new You track a question over time Most survey and interview projects
Strength Finds unexpected issues Fast and comparable across waves Comparable, still open to new issues
Risk Slow; codes drift between coders Misses anything outside the codebook Codebook grows without discipline

Use inductive coding for exploratory interviews or a new question, and deductive coding for a tracker that asks the same question every quarter. In our experience, hybrid qualitative coding is the right default: fixed codes keep waves comparable, and a watched Other bucket catches what is new.

How do you code qualitative data step by step?

  1. Write down the question the coding must answer. For example, “Why do customers cancel, and does it differ by plan?”
  2. Read a sample first. Read 50 to 100 responses to learn the language people use.
  3. Draft the codebook. Start from known reasons, from what the sample showed, or both.
  4. Do first-cycle coding. Assign every code that fits each response.
  5. Check agreement. Have a second person code the same subset and compare.
  6. Do second-cycle coding. Merge, split and rename codes, then group them into categories and themes.
  7. Count and cut. Count responses per code, compare segments and pull quotes per theme.

First-cycle coding labels the raw text, staying close to what people said. Second-cycle coding works on the codes themselves, grouping “late box” and “missing items” under a category such as delivery reliability. For the full survey workflow, see how to analyze open-ended survey responses.

How do you build a codebook for qualitative coding?

A codebook is the rulebook for qualitative coding: it lets two people code the same text the same way. Each code needs a short name, a one-line definition, include and exclude rules for edge cases, and an example quote. Here is a five-code template for a meal-kit cancellation survey.

Code Definition Include Exclude Example quote
Price and value Cost too high for what you get Discount ending, portion size Quality complaints alone “Cheaper to just buy the groceries myself.”
Delivery Problems getting a complete box on time Late or damaged boxes, missing items Delivery area (code Other) “Missing ingredients twice in a month.”
Food quality The food itself disappoints Freshness, taste, bruising Portion size (code Price and value) “The produce was often bruised.”
Variety Menu feels repetitive or limited Same recipes, few diet options Recipe difficulty “Same five recipes every week.”
Time and effort Cooking takes more time or skill than expected Prep time, complex steps Delivery wait “Cooking took 45 minutes, not the 20 on the card.”

The exclude column does most of the work. Without it, “portions too small” could land in Price and value or Food quality, depending on who is coding.

What does qualitative coding look like in a worked example?

These responses are illustrative, not from a real study. Ten customers answered “What is the main reason you cancelled?” We coded them with the codebook above, then inductively with no list.

# Response Deductive codes Inductive codes
1 “Too expensive for what you get, especially once the discount ended.” Price and value Discount ended
2 “Boxes kept arriving a day late, so the fish wasn’t fresh.” Delivery; Food quality Late delivery; Not fresh
3 “Same five recipes every week. Got bored.” Variety Repetitive menu
4 “Cooking took 45 minutes, not the 20 on the card.” Time and effort Longer than promised
5 “So much plastic and ice packs. I felt guilty every week.” Other Packaging waste
6 “Cheaper to just buy the groceries myself.” Price and value Cheaper to shop myself
7 “Missing ingredients twice in a month.” Delivery Missing items
8 “Portions too small for two adults, and pricey.” Price and value Small portions
9 “We moved and they don’t deliver to our new area.” Other Moved out of area
10 “Recipes were too complicated for weeknights and the produce was often bruised.” Time and effort; Food quality Too complex; Not fresh

Responses 2 and 10 each carry two codes. That is multi-coding: one answer can hold two reasons, and you keep both.

Now count the deductive codes. Price and value appears in 3 of 10 responses (30%); Delivery, Food quality and Time and effort in 2 each (20%); Variety in 1 (10%); Other in 2 (20%).

That is 12 code assignments across 10 responses, so the percentages add up to 120%. Report them as “share of respondents mentioning,” never as a pie chart.

The inductive pass found two issues the codebook missed: packaging waste and moving out of the delivery area. The hybrid move is to add “Packaging waste” as a code and watch whether it grows.

How do you measure intercoder agreement?

Before coding all 800 responses, have a second coder code the same 10. The simplest measure is percent agreement: responses where both coders assigned the same codes, divided by the total.

Say the coders matched on 8 of the 10. Coder B coded response 7 as Food quality and added Food quality to response 8. Percent agreement is 8 ÷ 10 = 80%. Both disagreements sit on rules the codebook already states, so the fix is to discuss them and add those quotes as examples.

Percent agreement ignores agreement that happens by chance, which is common with only a few codes. Cohen’s kappa corrects for it: kappa = (observed agreement − chance agreement) ÷ (1 − chance agreement). A kappa of 1 means perfect agreement, and 0 means no better than chance. Agree on the measure and the bar you will accept before coding starts.

What are the common mistakes in qualitative coding?

  • Coding before reading. The codebook fits your assumptions, not your data.
  • Vague code names. “Service” or “Experience” catch everything and explain nothing.
  • Forcing one code per response. Answers with two reasons undercount the second one.
  • Letting Other grow unread. A large Other bucket often hides the most important new issue.
  • Changing the codebook mid-wave. Recode earlier responses so counts stay comparable.

How do you put coded data to work?

For customer feedback, teams often need a continuous view of satisfaction drivers, journey friction and emerging issues. When the same codes run across several studies, connecting findings across studies and waves helps you reuse what earlier coding found. For large volumes, see how AI thematic analysis speeds up the first cycle alongside a human-checked codebook.

As a next step, take one open-ended question from your latest survey, read 50 answers, draft a five-code codebook, and ask a colleague to code 20 of them with you.

Frequently asked questions

What is the difference between a code and a theme?

A code labels one idea in one segment of text, such as "late delivery." A theme is a broader pattern built from several related codes, such as "the service is unreliable." Codes describe what people said; themes interpret what it means across the data.

How many codes should a codebook have?

There is no fixed number. Keep enough codes that the Other bucket stays small, and few enough that a coder can hold every definition in mind. If a code is almost never used, merge it. If Other keeps growing, read it and add codes.

Can you code qualitative data in a spreadsheet?

Yes. Put one response per row and one column per code, and enter 1 when a code applies and 0 when it does not. That layout handles multi-coding, makes counts a simple column sum and lets you cut codes by any segment column.

Can AI do qualitative coding?

AI can suggest inductive codes and apply a codebook to thousands of responses quickly. Treat its output like a new coder's: check a sample against your own coding, tighten definitions where it disagrees, and keep a person responsible for the final themes.

See your open ends in mTab.

Bring a study with open-ended responses. We'll show you the themes, the counts behind them and how they connect to the rest of your research.

Book a demo