onibaku.apps
Guide

How to number headings in Google Docs

Word can number headings 1, 1.1, 1.1.1 by itself. Google Docs can't: there's no heading numbering setting, so you either type the numbers, borrow a numbered list, or let a script or add-on do it. Here are the three ways, and where each one falls down.

Updated October 2026

First: use heading styles

Every method below works from heading styles, not big bold text. Select each section title and choose Format → Paragraph styles → Heading 1 (or 2, 3 for sub-sections). The outline on the left of the document shows whether you've got them all.

Method 1: a numbered list on the headings

  1. Click in your first Heading 1 and choose Format → Bullets & numbering → Numbered list, then pick the 1, 1.1, 1.1.1 style.
  2. Apply the same list to each of the other headings. When Docs asks, choose Continue previous numbering rather than starting at 1 again.
  3. For each Heading 2, click at the start of it and press Tab to move it down a level, so it becomes 1.1.

Things to know:

Method 2: an Apps Script

This script writes the numbers into the headings as text, so they show in the table of contents and in exports. Run it again after you move sections and it replaces the old numbers.

  1. In the document, choose Extensions → Apps Script, paste this and save:
// Numbers Heading 1 to Heading 3 as 1, 1.1, 1.1.1. Run it again to renumber.
function numberHeadings() {
  const H = DocumentApp.ParagraphHeading;
  const levels = [H.HEADING1, H.HEADING2, H.HEADING3];
  const counts = [0, 0, 0];
  const body = DocumentApp.getActiveDocument().getBody();
  body.getParagraphs().forEach((p) => {
    const level = levels.indexOf(p.getHeading());
    if (level < 0 || !p.getText().trim()) return;
    counts[level]++;
    counts.fill(0, level + 1);
    const text = p.editAsText();
    const old = p.getText().match(/^\d+(\.\d+)*\s+/); // a number from a previous run
    if (old) text.deleteText(0, old[0].length - 1);
    text.insertText(0, counts.slice(0, level + 1).join('.') + ' ');
  });
}
  1. Choose numberHeadings in the function menu, press Run and allow access.

Things to know:

Method 3: Heading Numbering & Table of Contents, no code

Heading Numbering & Table of Contents is an add-on that does what the script does, without the sharp edges. Decimal numbering is free.

  1. Install it from the Google Workspace Marketplace.
  2. In your document, choose Extensions → Heading Numbering & Table of Contents → Open.
  3. Pick which heading levels to number. If Heading 1 is your document's title, start at Heading 2. The preview shows the result before anything changes.
  4. Press Update numbering. After moving, adding or deleting sections, press it again.

It marks its own numbers, so "2026 Budget" keeps its 2026 and running it twice never doubles anything. Contents, Abstract and References are left unnumbered by default, typed numbers like "2.1 Scope" are spotted and can be replaced, and Remove takes every number off again. It can also insert a linked contents list that refreshes when you renumber.

Pro, at $4 a month or $29 a year, adds legal (1.1, (a), (i)), outline (I. A. 1.) and custom styles such as "Article 1", numbering across every document tab, and cross-references to "section 3.2" that update when the numbers change.

Here it is in 30 seconds:

Video: numbering, moving and renumbering headings in Google Docs (30 seconds, opens YouTube)

Get Heading Numbering & Table of Contents

Common questions

Does Google Docs have automatic heading numbering?

No. It has heading styles, an outline and a table of contents, but nothing that numbers headings by level. A numbered list gets close, but the levels have to be set by indenting each heading.

How do I get the numbers into the table of contents?

The numbers need to be part of the heading text, as Methods 2 and 3 do it. Then click the table of contents and press its refresh button.

Will the numbers survive a PDF or Word export?

Yes, with Methods 2 and 3, since the numbers are ordinary text. List numbers usually survive too, but can change style in Word.

Numbering contracts?

See how to number clauses in Google Docs, for 1.1, (a), (i) and clause references.

Writing a thesis or paper?

Effortless Academic has a good walkthrough of how to write a research paper in Google Docs, from structure to references, plus more tools and tips for academic writing at Effortless Academic.

Google Docs™ and Google Apps Script™ are trademarks of Google LLC. This add-on is not made or endorsed by Google.