Skip to main content
v2026.11,986 entries · CC-BY 4.0

Thematic Coding Analysis: Metrics, Steps & Worked Examples

A practical guide to thematic coding analysis: codebook construction, coding reliability formulas, Cohen’s kappa calculations, and APA 7th reporting.

Written and maintained by CASRAI Editorial Board

Published

On this page

Thematic coding analysis is a structured qualitative research method that identifies, categorizes, and quantifies recurring patterns of meaning across textual or multimedia datasets by systematically applying conceptual labels (codes) to defined text segments and synthesizing those codes into overarching thematic narratives. In rigorous empirical designs, thematic coding bridges interpretive depth and analytical reproducibility through formalized codebooks, intercoder reliability metrics such as Cohen’s kappa (κ), and auditable verification protocols that satisfy peer-reviewed reporting standards.

Definition of Thematic Coding Analysis

In empirical qualitative research, thematic coding analysis operates as both a data-reduction procedure and an interpretive synthesis framework. Investigators systematically segment raw textual records—such as semi-structured interview transcripts, focus group protocols, or field notes—into discrete units of analysis and assign standardized conceptual codes based on explicit operational criteria.

Methodologists distinguish between reflexive thematic analysis and codebook-driven thematic coding analysis. In reflexive thematic analysis, codes evolve organically through subjective interpretation. In contrast, codebook-driven thematic coding analysis, detailed in our guide to thematic analysis workflows, establishes a predetermined coding agenda, applies standardized definitions across all transcripts, and measures intercoder consistency across independent analysts to verify reliability.

Formulas for Coding Reliability and Agreement

When multiple independent analysts evaluate the same qualitative dataset, assessing coding consistency requires statistical reliability formulas. Simple raw agreement percentages often inflate reliability because they do not adjust for agreement occurring by statistical chance.

1. Raw Percentage Agreement (Holsti’s Index)

For two independent coders categorizing N pre-segmented units, observed percentage agreement (Po) is expressed as:

Po = (A / N) × 100

Where A represents the number of units with identical coding decisions, and N represents the total evaluated units (where N = A + D, and D represents total disagreements). For freely unitized text, Holsti’s composite index is PAo = 2M / (N1 + N2), where M is total joint agreements and N1 and N2 represent coding decisions made by each analyst.

2. Cohen’s Kappa Coefficient (κ)

To adjust for chance agreement arising from code prevalence or guessing, Jacob Cohen formulated the kappa coefficient (κ):

κ = (Po − Pe) / (1 − Pe)

Where Po represents observed proportional agreement, and Pe represents expected chance agreement derived from marginal distributions: Pe = [(R1 × C1) / N2] + [(R0 × C0) / N2]. In these equations, R1 and R0 represent the row marginal totals of presence and absence for Coder 1, while C1 and C0 represent the column marginal totals for Coder 2.

3. Coding Density Metric

Qualitative researchers also monitor narrative coding saturation using coding density: CD = Capplied / Utotal, where Capplied is the count of applied code instances and Utotal is the total volume of text units measured in words or paragraphs.

Worked Example of Thematic Coding Analysis with Real Numbers

To demonstrate the exact arithmetic required for calculating intercoder reliability, consider a qualitative study of healthcare provider burnout. Two independent researchers, Coder A and Coder B, evaluated N = 100 interview segments for the presence (1) or absence (0) of the deductive code “Emotional Exhaustion”.

Step 1: 2×2 Contingency Matrix

The compiled independent classifications produced the following contingency matrix:

Coding Decisions Coder B: Present (1) Coder B: Absent (0) Coder A Marginal Totals (R)
Coder A: Present (1) 35 10 45 (R1)
Coder A: Absent (0) 5 50 55 (R0)
Coder B Marginal Totals (C) 40 (C1) 60 (C0) 100 (Total N)

Step 2: Observed Agreement (Po)

Observed agreement sums the concordant diagonal cells:

A = 35 (both present) + 50 (both absent) = 85 segments.

Po = 85 / 100 = 0.8500 (85.0%)

Step 3: Expected Chance Agreement (Pe)

Expected agreement calculates the joint probability of chance concordance based on marginal distributions:

  • Coder A identified presence in 45% of segments (45 / 100 = 0.45); Coder B in 40% (40 / 100 = 0.40). Joint chance presence: 0.45 × 0.40 = 0.1800.
  • Coder A identified absence in 55% of segments (55 / 100 = 0.55); Coder B in 60% (60 / 100 = 0.60). Joint chance absence: 0.55 × 0.60 = 0.3300.
  • Total expected chance agreement: Pe = 0.1800 + 0.3300 = 0.5100 (51.0%).

Step 4: Computing Cohen’s Kappa (κ)

Applying the chance-corrected formula:

κ = (0.8500 − 0.5100) / (1.0000 − 0.5100)

κ = 0.3400 / 0.4900 = 0.6939 ≈ 0.694

The resulting coefficient of κ = 0.694 establishes substantial intercoder agreement, confirming that the operational code definition is robust and reproducible.

Interpretation and Benchmark Guidance

Interpreting intercoder agreement requires referencing established methodological standards while accounting for code frequency. The following benchmark hierarchy, adapted from Landis and Koch (1977) and Fleiss (1981), guides analytical decisions in qualitative thematic coding:

Kappa Value (κ) Observed Agreement (Po) Agreement Level Methodological Action
Below 0.20 Below 50% Poor Code definition is ambiguous. Stop coding, revise inclusion criteria, and retrain analysts.
0.21 to 0.40 50% to 69% Fair High discrepancy. Clarify boundary rules and conduct another pilot calibration round.
0.41 to 0.60 70% to 79% Moderate Acceptable for exploratory research, but insufficient for clinical or evaluative studies.
0.61 to 0.80 80% to 89% Substantial Standard acceptable threshold for peer-reviewed qualitative research. Discrepancies reconciled via consensus.
0.81 to 1.00 90% to 100% Almost Perfect High reliability. Single-coder analysis may proceed on remaining data with spot checks.

In codebook thematic analysis, achieving substantial agreement (κ ≥ 0.61) is followed by a consensus conference where coders review all discrepant units (such as the 15 discordant units in our example) to reach agreed classifications before final thematic aggregation.

Assumptions and Common Mistakes in Thematic Coding

Rigorous thematic coding analysis depends on fulfilling several theoretical and operational assumptions:

  • Unitization Consistency: Coders must evaluate identical textual boundaries. Discrepancies between clause-level and paragraph-level coding distort agreement metrics. Transcripts should be pre-segmented before independent coding begins.
  • Preventing Code Drift: In large qualitative studies, coders experience code drift as familiarity with the data alters their interpretation of criteria. Periodic calibration checks on 10% samples mitigate this drift.
  • Distinguishing Frequency from Significance: High code frequency indicates commonality but does not guarantee thematic significance. A low-frequency code reflecting a critical negative case can carry substantial theoretical importance.
  • Epistemological Alignment: Calculating intercoder reliability belongs to codebook-driven thematic analysis and content analysis. Imposing quantitative reliability metrics on purely reflexive, constructivist thematic analysis misapprehends its interpretive epistemology.

How to Report Thematic Coding Analysis (APA Example)

The APA Journal Article Reporting Standards for Qualitative Research (APA JARS-Qual, Levitt et al., 2018) require explicit reporting of codebook development, coder calibration, and reliability statistics. Qualitative manuscripts should document coding software, double-coding percentages, and discrepancy resolution.

APA 7th Reporting Narrative

Manuscripts can report thematic coding analysis using the following model paragraph:

“Transcripts were analyzed using codebook-driven thematic analysis. An initial codebook containing operational definitions and inclusion criteria was developed and pilot-tested on a randomly selected 20% sample of transcripts. Two independent raters coded 100 pre-segmented textual units to determine intercoder reliability. Intercoder agreement for the primary code ‘Emotional Exhaustion’ demonstrated 85.0% observed agreement (Po = 0.85) and an expected chance agreement of 51.0% (Pe = 0.51), yielding a substantial Cohen’s kappa coefficient of κ = 0.694 (95% CI [0.54, 0.85]). Discrepant coding units (15%) were subsequently reconciled during a consensus conference. Qualitative coding was organized using NVivo (Version 14).”

Codebook Audit Trail Table

Including an audit trail table substantiates coding transparency:

Code Label Operational Definition Inclusion Criteria Exclusion Criteria Exemplar Quote
Emotional Exhaustion Statements describing feeling drained or lacking emotional resources for patient care. Mentions of affective depletion, burnout, or inability to empathize. Physical tiredness caused purely by acute sleep loss without affective depletion. “By Thursday, I feel completely empty inside with nothing left to give.”
Institutional Friction Expressions of frustration with administrative software or bureaucratic mandates. Complaints regarding electronic health records or administrative overhead. Clinical disagreements with colleagues regarding patient treatment plans. “We spend hours clicking drop-down boxes for every hour of patient care.”
Peer Solidarity Descriptions of deriving resilience or validation from co-workers. Informal debriefings, team mutual support, or colleague mentorship. Formal institutional wellness lectures or employee assistance programs. “The only reason I survived that shift was because my colleague stepped in.”

How to Calculate Coding Agreement in Excel, R, and Python

Intercoder reliability metrics can be computed directly in standard spreadsheets, R programming scripts, or Python scripts.

1. Microsoft Excel Formulas

In a 2×2 table arranged in cells B2:C3 (B2=35, C2=10, B3=5, C3=50):

  • Row Marginals: Cell D2: =SUM(B2:C2) (45); Cell D3: =SUM(B3:C3) (55)
  • Column Marginals: Cell B4: =SUM(B2:B3) (40); Cell C4: =SUM(C2:C3) (60)
  • Total Units (N): Cell D4: =SUM(B2:C3) (100)
  • Observed Agreement (Po): Cell B6: =(B2+C3)/D4 (0.850)
  • Expected Agreement (Pe): Cell B7: =(D2*B4 + D3*C4)/(D4^2) (0.510)
  • Cohen’s Kappa (κ): Cell B8: =(B6-B7)/(1-B7) (0.6939)

2. R Script

// Matrix computation in R
matrix_data = matrix(c(35, 10, 5, 50), nrow = 2, byrow = TRUE)
total_n = sum(matrix_data)
po = sum(diag(matrix_data)) / total_n
row_m = rowSums(matrix_data)
col_m = colSums(matrix_data)
pe = sum(row_m * col_m) / (total_n^2)
kappa_val = (po - pe) / (1 - pe)
cat(sprintf("Observed Agreement: %.4fn", po))
cat(sprintf("Cohen's Kappa: %.4fn", kappa_val))

3. Python Script

// Contingency table computation in Python
table = [[35, 10], [5, 50]]
n = sum(sum(row) for row in table)
po = (table[0][0] + table[1][1]) / n
r1, r0 = sum(table[0]), sum(table[1])
c1, c0 = (table[0][0] + table[1][0]), (table[0][1] + table[1][1])
pe = (r1 * c1 + r0 * c0) / (n ** 2)
kappa = (po - pe) / (1 - pe)
print(f"Observed Agreement: {po:.4f}")
print(f"Cohen's Kappa: {kappa:.4f}")

What are the types of coding in qualitative research?

Qualitative inquiry employs multiple coding typologies across First Cycle and Second Cycle analysis, as outlined in Johnny Saldaña’s coding manual:

  • Descriptive Coding: Assigns basic topic labels to summarize passages (e.g., “housing history,” “medication adherence”).
  • In Vivo Coding: Applies participants’ verbatim words as the code label (e.g., “cog in the wheel”), preserving authentic participant voice within grounded theory methodology.
  • Process Coding: Uses gerunds (“-ing” words) to document continuous actions, routines, and interpersonal dynamics (e.g., “negotiating boundaries,” “seeking validation”).
  • Initial / Open Coding: Granular, exploratory line-by-line coding that breaks data down into emergent conceptual fragments.
  • Axial Coding: Relinks categories by identifying core phenomena, contributing causal conditions, contexts, and behavioral outcomes.
  • Pattern Coding: Second-cycle synthesis that groups related first-cycle codes into overarching meta-codes and explanatory themes.

Is NVivo better than ChatGPT?

Evaluating whether Lumivero’s NVivo is superior to OpenAI’s ChatGPT depends on research requirements regarding auditability, privacy, and analytical purpose:

  • Auditability and Provenance: NVivo provides a deterministic database where code tags remain permanently linked to source character coordinates. In contrast, ChatGPT is probabilistic; identical queries can produce non-identical coding outputs, complicating peer-reviewed audit trails.
  • Privacy and IRB Compliance: Academic and clinical protocols governed by IRBs, HIPAA, or FERPA require secure, encrypted environments. Standard cloud LLMs may retain user prompts, whereas NVivo operates locally on encrypted institutional workstations.
  • Interpretive Depth vs. Rapid Synthesis: ChatGPT excels at rapid syntactic summarization and exploratory candidate code generation. However, it risks hallucinations and lacks deep understanding of cultural nuances and non-verbal subtext.
  • Recommended Hybrid Workflow: Research teams achieve optimal results using ChatGPT for initial exploratory code ideation, followed by human-driven codebook refinement and formal double-coding verification within NVivo.

How to thematic analysis coding?

Conducting thematic analysis coding involves five structured phases synthesized from Braun and Clarke’s qualitative framework and Philipp Mayring’s qualitative content analysis protocols:

  1. Familiarization and Unitization: Read the entire dataset thoroughly to understand context, then segment transcripts into discrete units of analysis. As explained in our guide to content analysis methods, uniform unitization prevents coder mismatch.
  2. Initial Code Generation: Review transcripts systematically to generate inductive or deductive code labels with preliminary operational definitions.
  3. Codebook Piloting and Calibration: Finalize a structured codebook and test it across independent analysts on a 10% to 20% sample. Compute Cohen’s kappa (aiming for κ ≥ 0.61) and resolve discrepancies before full-text coding.
  4. Collating Codes into Candidate Themes: Following full-scale coding, cluster related codes into broad candidate themes that capture shared conceptual properties, as outlined in our reference on qualitative data processing.
  5. Reviewing and Defining Final Themes: Verify candidate themes against coded extracts and the entire dataset, creating precise thematic names and explanatory narratives that answer the research questions.

What is coding in research example?

To illustrate how textual data transforms into empirical codes and themes, examine this interview excerpt from a remote work study:

“My manager sends messages at 9:30 PM, and if I do not respond quickly, I feel this pit in my stomach that I am seen as unproductive. The laptop sits on my dining table all evening. I cannot disconnect, and I snap at my partner because my mind is constantly on standby.” (Participant 14)

The excerpt is segmented into three analytical units:

Text Segment (Unit of Analysis) Applied Code Label Coding Type Analytical Focus
“My manager sends messages at 9:30 PM… I feel this pit in my stomach…” Asynchronous Availability Pressure Descriptive / Affective Captures perceived occupational demands and associated affective anxiety.
“The laptop sits on my dining table all evening. I cannot disconnect…” Spatial Boundary Dissolution In Vivo / Metaphoric Documents the intrusion of occupational tools into domestic living environments.
“…and I snap at my partner because my mind is constantly on standby.” Interpersonal Strain Spillover Process Records behavioral strain spilling over from cognitive work arousal into domestic relationships.

Across the complete dataset, these codes are synthesized into an overarching qualitative theme: “Domestic Colonization and Chronic Standby Arousal.” This theme encapsulates the structural mechanism causing worker burnout in remote environments.

Frequently asked questions

What are the types of coding in qualitative research?

The primary qualitative coding types include descriptive coding (indexing topics), in vivo coding (preserving verbatim participant phrases), process coding (tracking actions and behaviors using gerunds), open/initial coding (exploratory line-by-line labeling), axial coding (linking categories to causal conditions and contexts), and pattern coding (synthesizing first-cycle codes into meta-themes).

Is NVivo better than ChatGPT?

NVivo provides deterministic audit trails, secure local data storage compliant with IRB and HIPAA standards, and coding comparison queries to verify intercoder reliability. ChatGPT offers rapid exploratory code ideation and semantic clustering. The most effective contemporary methodology combines both tools in a supervised hybrid workflow.

How to thematic analysis coding?

Thematic analysis coding proceeds through five phases: familiarization and transcript unitization, initial code generation, codebook piloting with intercoder reliability testing (Cohen’s κ ≥ 0.61), collating codes into candidate themes, and reviewing and finalizing overarching themes against the entire dataset.

What is coding in research example?

A concrete coding example involves analyzing a passage such as “The laptop sits on my dining table… I cannot disconnect,” assigning the code “Spatial Boundary Dissolution,” and aggregating it with related codes into an overarching qualitative theme such as “Domestic Colonization.”

What percentage agreement is acceptable for qualitative research codebooks?

Observed percentage agreement should reach at least 80% to 85%, but researchers must report chance-corrected coefficients such as Cohen’s kappa (κ). A threshold of κ ≥ 0.61 represents substantial agreement and is the standard benchmark for peer-reviewed qualitative publications.

What is the difference between open coding and thematic coding?

Open coding is an initial exploratory technique that fractures qualitative text into discrete fragments with provisional labels. Thematic coding is a comprehensive multi-stage framework that refines codes using structured codebooks, evaluates intercoder consistency, and aggregates codes into explanatory themes.

What must a qualitative research codebook contain?

A qualitative codebook must provide five essential elements for each code: the standardized code label, an operational definition, explicit inclusion criteria, explicit exclusion criteria distinguishing it from adjacent codes, and exemplar quotations from pilot data.

Sources

Data: Qualitative Intercoder Agreement Metrics and Benchmark Thresholds

Original methodological comparison of statistical reliability metrics, mathematical formulas, chance-correction properties, minimum sample sizes, and accepted benchmark thresholds across qualitative research traditions and coding frameworks.

Period covered: 2024/2026. Coverage: Global.

Qualitative Intercoder Agreement Metrics and Benchmark Thresholds
Metric NameDeveloper & YearChance CorrectionMinimum Sample Units (units)Substantial Agreement Threshold (coefficient)Primary Application Context
Percentage AgreementHolsti (1969)No500.8Preliminary exploratory coding and initial codebook calibration
Cohen's KappaCohen (1960)Yes1000.61Two-coder nominal categorization in structured qualitative content analysis and NVivo queries
Fleiss' KappaFleiss (1971)Yes1000.61Multi-coder nominal categorization involving three or more independent qualitative analysts
Krippendorff's AlphaKrippendorff (1980)Yes1200.67Unstructured text unitization, missing coding data, and ordinal or ratio qualitative scales
Gwet's AC1Gwet (2008)Yes800.65High-prevalence qualitative codes where Cohen's kappa exhibits the kappa paradox penalty

Sources

Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · full access

Ask about Thematic Coding Analysis: Metrics, Steps & Worked Examples

Full access: large monthly usage, up to 10 source passages behind each answer, and MCP and API access for Claude Code, Codex and other CLIs. Cancel any time.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →