Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Is it possible to add numbering to headings in Confluence?


In Confluence we have headings and we have numbered lists.

Is it possible to combine the two (and then use them as part of a template)?

And to have the numbering working automatically?

The idea is that this would work as it does in Word. So once you start using numbered headings, all subsequent headings get numbered both automatically and down a level each time. For example:

Heading 1 = 1. A Heading

<some text>

Heading 2 = 2.1 Help

<some text>

Heading 2 = 2.2 I Need

<some text>

Heading 2 = 2.3 Your Help

<some text>

Etc, etc, so everytime a new heading level was added, the numbering also changed to accommodate that.

Does this make sense?


12 answers

1 accepted

8 votes
Answer accepted

There's a third-party plugin for that:

Amalia, thanks for pointing me in the right direction. :)

But it's not available for OnDemand instances :(

The add-on now has a stable OnDemand counterpart, you can find it here.

Numbered Headings is now available for Cloud, Server and Data Center:

We've installed Numbered Headings Free on server, but cannot find any button to insert number. Is it possible to add number in free version, or it only provides view function?

@Jian YaoThe free version of Numbered Headings uses a macro to number your headings. You can find the macro in the macro browser by search for 'Numbered Headings'.

The button in the editor is only available in Numbered Headings Pro.

I can't believe that such a basic and essential wiki/documentation/knowledge space functionality is still not implemented natively in Confluence, and requires either some hacks with consequences or a 3rd party paid plugin. There is a plugin for everything, it seems, and they all add up in costs, both direct and maintenance. We are starting to get feed up with this approach by Atlassian, and looking at moving away from their products completely. 

Like # people like this

Hi Arkadiy and Kim,

I also agree with your point that must to have features should be provided by Atlassian by default. But you also must appreciate that due to this open platform, many features are available at marketplace in form of add-ons. This way at least user can get away with the problem being faced. Wiki/documentation/ knowledge space has so much varied requirements as per use cases that it is very difficult for a close platform to serve all type of needs single handed.

Hi Nancy Jaiswal,

Indeed that an open platform like Confluence would let developers create more useful add-ons for end users. I do support this mindset and developers should also make money for their living.

But c'mon, we are in 2019 now, not in the '90s anymore.

Numbering to headings should be a must-have feature instead of an addon. If numbering is not a standard default feature, in my point of view, Confluence should not be called a WIKI system.

Not only that, you cannot even increase text size in Confluence neither, to increase text size you have to use the Macro DIV, correct me If I am wrong.

For IT dummies who are working in a Finance or Marketing department, asking them to use Macro DIV for increasing text size, they would curse the system to death :)

If you look at Wordpress, Drupal or other open source CMSs, their WYSIWYG editor includes all these features for free. You might ask me why I will not Wordpress or Drupal instead, well, it's a different topic and debate :)



Like # people like this

Hi Kim,

If you will read my comments, I too support basic features in default list of Confluence features. In my opinion it is not the philosophy of letting developers earn their living to prosper a business, it is about providing value to customer.

For providing control on text size, someone from Atlassian can better answer but my take is that any content management system should be controlled one. If you are aware of DITA philosophy, they are trying to provide controlled and limited set  of features to content creators so that uniformity and better search ability could be brought to content. My only point of mentioning this is that providing everything that exist in other editors may not always be a good idea in today's world were volume of content being created is tremendous.




Hi Nancy, 

Agreed with most of the thing you wrote here. I don't expect that we must include all features, but if we need to call someone then we don't basically need a smartphone right, we can use a dumb phone to call someone. For me, a wiki system should include numbering to headings heading which is one of the fundamental need to build Wiki pages. Not sure how other thinks, just my opinion :)

Regarding data volume, if we follow Moore's Law then data storage technology might not stop here and will not limit us from saving more data.  The questions here is what's in is for me and what Atlassian is willing to give us.

Maybe the Atlassian can give us a new option, they provide us the Confluence system, but we can decide to save our data wherever we wanted, either in Azure, Google Cloud or AWS etc.. :)





Hello Nancy, 

I am all for "open" platform and the added value added by the 3rd party developers. However, what we are talking about here (and many other cases), is the basic functionality of any CMS/Wiki system that has existed for ages. I should not be required by Atlassian to go and purchase a host of 3rd party plugins (often of questionable quality, and not always available for the full platform offering) to cobble together a decently working Wiki. It's a huge turn off, and will surely drive the user base away from Atlassian altogether. 

Right now, the only reason to use Confluence for us, is because of integration with Jira, but we are seriously questioning the value there, that surely can be replicated with a few other ecosystem offerings.

Again, basic formatting is NOT a good candidate for a 3rd party offering, in my opinion. It's like if you ordered a BMW, but had to pay extra for a 3rd party door handles, because it didn't have one in the stock offering. 

Like # people like this

Are you really surprised? They refuse to support inserting tab characters without a plugin.

Like Mubed likes this

Hi guys,

i've been following your discussion here and wondering if there's still no other way for the numbered headings problem except the plugin or complicated hacks.

I hope every month for a good news in "Whats new in confluence cloud" :)


Do you happen to know something about it?




Like # people like this

Hi Katharina,

Unfortunately till now there is no inbuilt direct way of getting headings numbered  in my knowledge.



Hi Nany,


that is more than a pity.


thanks for your help.

Like Karl Jamaels likes this

I totally agree, it's a shame that such simple feature is not supported by default.

Since all answers here either suggest paid plugins or extensive use of javascript macros I wanted to note that numbering headings can easily be done with a stylesheet (which can be applied globally or space-wide depending on your preferences) using css counters: {
     /* Set "section" to 0 */
    counter-reset: section;
} h1 {
     /* Set "subsection" to 0 */
    counter-reset: subsection;
} h1:before {
    /* Increment "section" by 1 */
    counter-increment: section;
    content: counter(section) " ";

/* Continue this scheme as deep as you need */ h2 {
    counter-reset: subsubsection;
} h2:before {
    /* Increment "subsection" by 1 */
    counter-increment: subsection;
    content: counter(section) "." counter(subsection) " ";
} h3:before {
    counter-increment: subsubsection;
    content: counter(section) "." counter(subsection) "." counter(subsubsection) " ";

Hi, this doesn't work for me. I want to add section numbering in my PDF report. Where do I have to paste your css?

Very nice, thank you

It works fine for viewing document! But during editing, the numbers are not displayed. Any suggestion for display numbers when edit documents?

Thanks Florian, works well for me in non-edit mode. Confluence should incorporate a macro to add.remove at will.

Is there a way to apply this per page?

If you place an "html" macro at the top of the page and include the noted css inside a <style></style> block inside the macro then it will work for that page only.

Alternatively, the "html" macro can be added to an otherwise empty page and then use the "Include page" macro to include this page. Advantage: any changes made to the style in included page will rendered all pages where it is included.

Like # people like this

It works amazing good for me!

Thanks so much for providing this free solution!

If you'd like the same for editing, copy the same for the .contentLayout2 class. For instance the last chunk would look like following:

.contentLayout2, h3:before {
    counter-increment: subsubsection;
    content: counter(section) "." counter(subsection) "." counter(subsubsection) " ";

What's more interesting that this doesn't always work with sections and on some places skips (just some!!). I don't get it, perhaps there really is a CSS magic among us.


Great suggestion.

Following up on @Richard Colvin for applying in selected pages, is it possible to create a no-body custom macro and declare the <style></style> in it?

In this way you could skip enabling the HTML macro for security reasons.

Thanks, it's working perfectly ! But I changed the id and the class to not affect the comments section : {
/* Set "title1" to 0 */
counter-reset: title1;
} h1 {
/* Set "title2" to 0 */
counter-reset: title2;
} h2 {
/* Set "title3" to 0 */
counter-reset: title3;
} h3 {
/* Set "title4" to 0 */
counter-reset: title4;
} h4 {
/* Set "title5" to 0 */
counter-reset: title5;
} h5 {
/* Set "title6" to 0 */
counter-reset: title6;
} h1:before {
/* Increment "title1" by 1 */
counter-increment: title1;
content: counter(title1) ". ";
} h2:before {
/* Increment "title2" by 1 */
counter-increment: title2;
content: counter(title1) "." counter(title2) ". ";
} h3:before {
/* Increment "title3" by 1 */
counter-increment: title3;
content: counter(title1) "." counter(title2) "." counter(title3) ". ";
} h4:before {
/* Increment "title4" by 1 */
counter-increment: title4;
content: counter(title1) "." counter(title2) "." counter(title3) "." counter(title4) ". ";
} h5:before {
/* Increment "title5" by 1 */
counter-increment: title5;
content: counter(title1) "." counter(title2) "." counter(title3) "." counter(title4) "." counter(title5) ". ";
} h6:before {
/* Increment "title6" by 1 */
counter-increment: title6;
content: counter(title1) "." counter(title2) "." counter(title3) "." counter(title4) "." counter(title5) "." counter(title6) ". ";


Engineering Essentials has just been released to the public.

This resolves the issue of numbered headings space-wide, without needing to put your content inside a macro.

With Engineering Essentials it is now possible to configure an entire space to have numbered headings. Any enabled space will instantly have it's headings numbered. No additional editing of a page is required. This enforces a consistent look and feel within each space. Additionally, because your content does not need to be wrapped in a macro it does not interfere with page differences, change emails, exports, or other plugins. Ensuring your content will continue to be available into the future, regardless of what plugins you have installed. This simplifies export templates and improves compatibility by defining the correct layout for the particular format within your own templates.

As numbered headings are often required for formal documentation we've also provided the ability to separately force version comments on all changes within a space. Enabling fully automatic change history documentation.

With years of experience supporting Confluence in an engineering environment, Precision Plugins have big plans to plug some small gaps, helping Confluence and other extensions be the best environment for your formal documentation.

Checkout the Engineering Essentials package and let us know what you think here:

This plugin still not supported in Cloud.
Atlassian has known about this issue for a decade and still makes it another required co$t. I'm not a coder so adding a stylesheet and code as described below isn't really an option. 

It is absolutely ridiculous that in 2021 numbered headings and text size differences aren't supported natively. It's not the 20th century anymore. What's next, Atlassian? Smoke signals.

Poor form....

totally agree

Like # people like this

Here is my little solution, using JQuery in the HTML MACRO.

<script type="text/javascript">

function enumerateHeaders() {
    var i1 = 0;
    var i2 = 0;
    var i3 = 0;

    AJS.$("#main-content :header").each( function(indx) {
        hdr = $(this);
        console.log( indx+": "+hdr.text() );
        switch (hdr.prop("tagName")) {
        case "H1":
            i1++; i2=0 ; i3=0;
            hdr.text( i1+") " + hdr.text() );
        case "H2":
            i2++; i3=0;
            hdr.text( i1+"."+i2+") " + hdr.text() );
        case "H3":
            hdr.text( i1+"."+i2+"."+i3+") " + hdr.text() );




This approach covers TOC as well, where you can include/exclude sections and subsections via regex provided by the TOC macro.

Here's the OnDemand version of the plugin (I can't edit Amalia's answer)

Currently it has some issues but I hope they get resolved in near future

Since then both the add-on and the OnDemand platform have seen vast improvements. Check our issue tracker for the current status:

We've recently updated our add-ons website. Anyone looking for help on Numbered Headings can find it here:

As all tickets gets automatically resolved in 3 years, I'll sign myself out from these tickets.

Good-Bye Confluence Server

Hi All,

It seems like a very very long pending issue with Confluence.

I found something that sort of works

The script works really really well, except the headings start at 3 and everything (even things in the sidebar) get numbered. It will be awesome if someone can figure out how to get this working. I know that there are free plugins, but they clutter up the document and remove the clarity. If we get this working, we can simply put this into <head> and then bingo, everything is right the way it should be.

window.onload = function () {
  var elements=document.getElementsByTagName('*');
  var numbers=[0,0,0,0,0,0,0];
  for (var i in elements) { 
    var e=elements[i];
    var eLevel=RegExp.$1;
    var txt='';
    for(var l=1;l&lt;=6;l++) {
      } else {
    e.textContent=txt+' '+e.textContent.replace(/^[0-9\.\s]+/,'');

To try this,

Put the current script in the HTML macro at the end of the page.

I think we need to change this line

var elements=document.getElementsByTagName('*');

The document should be replaced by something that confluence knows as 'page contents'. Please see if you guys can solve this!

I created a script (copied some code from ) you can use in Confluence editor. You can add the script to usermacro and add the macro to header via space tools -> look and feel.

Hotkey hh and a button in the editor.


AJS.whenIType('hh').execute(function () { //hotkey

function addIndex() {
var indices = [];
jQuery("#wysiwygTextarea_ifr").contents().find("h1,h2,h3").each(function(i,e) { //.find("h1,h2,h3,h4,h5,h6") if you want all headings numbered
var hIndex = parseInt(this.nodeName.substring(1)) - 1;
if (indices.length - 1 > hIndex) {
indices= indices.slice(0, hIndex + 1 );
if (indices[hIndex] == undefined) {
indices[hIndex] = 0;
if(jQuery(this).text().indexOf(indices.join(".")+" ") <0 ){
jQuery(this).prepend(indices.join(".")+" ");

AJS.$('#rte-toolbar > div.aui-toolbar2-primary.toolbar-primary').append('<ul class="aui-buttons"><li class="aui-button" id="addIndex">Number headings</li></ul>')
AJS.$("#addIndex").click(function(e) {


Hello Markus, just wanted to thank you. Works great!

Few more tweaks:

  1. Removes old heading numbers
    1. Removes all numbers from the start of the heading (including dates for example)
  2. does not lose inline comments or inline macros
function addIndex() {
var indices = [];
jQuery("#wysiwygTextarea_ifr").contents().find("h1,h2,h3").each(function(i,e) { //.find("h1,h2,h3,h4,h5,h6") if you want all headings numbered
var hIndex = parseInt(this.nodeName.substring(1)) - 1;
if (indices.length - 1 > hIndex) {
indices= indices.slice(0, hIndex + 1 );
if (indices[hIndex] == undefined) {
indices[hIndex] = 0;
var lapset=[];
var text = AJS.$(this).prop('outerHTML');
jQuery(this).html(indices.join(".")+". " + removeNo(jQuery(this).text()));


function removeIndex(){
jQuery("#wysiwygTextarea_ifr").contents().find("h1,h2,h3,h4,h5,h6").each(function(i,e) {
var lapset=[];
var text = AJS.$(this).prop('outerHTML');

function removeNo(str) {
let newstr = str.trim();
newstr = newstr.replace(/[\u00A0\u1680​\u180e\u2000-\u2009\u200a​\u200b​\u202f\u205f​\u3000]/g,' ');
if(IsNumeric(newstr.substring(0,newstr.indexOf(' ')))){
return newstr.substring(newstr.indexOf(' ')+1).trim();
return newstr;

function IsNumeric(num) {
num = num.split('.').join("");
return (num >=0 || num < 0);
Like Kumar Vishwanathan likes this

I noticed it also added some dots to the numbering that weren't there before.

Thanks a lot again.

Btw I call the function removeIndex() right before addIndex(). I hope that's the intended usage.

I have a dedicated button for the removeIndex() function that I can use if I want to remove the numbers from headings. You don't have to call the function before addIndex, the addIndex removes the numbers too.

jQuery(this).html(indices.join(".")+". " + removeNo(jQuery(this).text()));
AJS.$('#rte-toolbar > div.aui-toolbar2-primary.toolbar-primary').append('<ul class="aui-buttons"><li class="aui-button aui-button-compact" id="addIndex">Number headings</li><li class="aui-button aui-button-compact" id="removeIndex">remove index</li></ul>')
AJS.$("#addIndex").click(function(e) {
AJS.$("#removeIndex").click(function(e) {

Alright, I see it now. Thank you.

Thanks for posting this. I've converted your code into a TamperMonkey script so that those of us without admin access to Confluence can use it.

Like markusjenu likes this

Hello @markusjenu ,

I am new in installing this. Installation successful but seems not working on current Confluence Cloud version: I don't see the icon in the menu bar:

Confluence editor menu bar.PNG

Best Regards.

Hi All,

We have released Auto Numbered Headings plugin  which auto numbers the headings of whole space in single click of button. A macro comes along with plugin in case numbering needs to be applied only on selective pages.

The link does not work (anymore).

@Chri Brunumbering all headings in a whole space is also available on the Server and Data Center version of Numbered Headings.

Oh, OK, this one I know, but I don't have budget for the plugin.

Anyway, thanks for the new link :)

The app that Nancy posted about 'Auto Numbered Headings' can be found here:

I shared the link to an alternative in my previous reply, since it looked like the app wasn't available.

Like Christian Sprenger likes this

Cool, thanks for that, I'll look into that :)

@markusjenu   - Could you please provide step by step to add this code in in confluence

I am trying to replace numbered heading addon in confluence. Could you please help us with this.

I've been using the add-on for a while now, mostly with success, but recently, pages that were created 12-15 months ago now behave very strangely when I try to edit.  The page flashes and scrolls elsewhere every time I make a single key-stroke.   It is completely unusable.  Perhaps this is due to changes Atlassian has rolled out in the cloud but the add-on is no fully compatible with. 

I will be reaching out to the add-on supplier for an explanation/fix , but wanted to raise my hand in vote that this functionality should be fundamental / native in Confluence.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence

🏑 Atlympic Event: Confluence

Hello Community!  Quick disclaimer: We are running a contest on Community (The Atlympics!) from July 23rd - August 8th of 2021. If you are interested in participating in this contest (prizes! ...

334 views 13 10
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you