Line Numbers in InDesign

Display Line Numbers in InDesign (CS4 onwards)

This script enhances InDesign’s feature-set. You can now add line numbers to your InDesign pages.

Important Notice: Please visit for the latest version of this script. Thank you. This page is no longer being updated!


Works with: InDesign CS4, CS5, CS5.5, CS6, and the new CC (Creative Cloud) on Windows and Mac computers.

New! Version 3.4 Now Released!

  • New feature: Three Four placement options (Outside Margin, Left Margin, Right Margin, Inside Margin) allows you to choose where the numbers should appear on the page.

New! Version 3.3 Now Released!

  • New feature: Restart line-numbering based on paragraph style(s). Whenever a user-specified paragraph style is encountered, the numbering will restart from one.

To download a demo, click here.

To purchase the full version of the script, click on the “Buy Now” button toward the bottom of this page.

Main Features

  • Add line numbers to selected paragraph styles only.
  • Add numbers at user-selected intervals: 5 … 10 … 15 … 20 or 3 … 6 … 9 … 12 etc.
  • The line numbers are placed in a text frame with their own object style, and the line numbers are given their own paragraph style – so you can quickly and easily change all aspects of the line-number formatting.
  • Optimized for speed.


  • Add line numbers to your book design. Poetry, academic editions of classic texts, and many other books require line numbers in the margins. This script gives you all the flexibility you need to easily add such numbers.
  • As a book designer, you may often receive corrections from authors and editors that say something like: “23rd line from bottom, please add a comma.” With this script you can speed things up, as InDesign will now display line numbers besides each line (see screenshots below). The Display Line Numbers script can add line numbers to a single text frame, or to an entire story.

How To Use the Script

In the script dialog box (shown below), select whether you wish to add numbers to the entire document, the current story, or the selected text frame only.

Choose whether you wish to add numbers to each line or at intervals (between 1 and 20) – simply select your desired interval from the dropdown menu.

Choose whether you would like the numbering to restart on each page, or whether an entire story should be renumbered consecutively.

Choose where you’d like the numbers to be placed. There are 3 options in the dropdown menu: “Outside Margin” will place the numbers in the left margin on a left-hand page, and in the right margin on a right-hand page. The other two options will force the numbers to always be placed in the left or right margin, respectively, regardless of which page they appear on.

Choose which paragraph styles you’d like to number: double-click on a paragraph style in the list on the left to select/deselect it, or use the “Select All” and “Deselect All” button at the bottom of the list.

Finally, you can choose to restart the numbering whenever the script reaches a certain paragraph style. For instance, in a book of poetry, you may want the numbering to restart whenever the script reaches a paragraph style called “Poem Title” so that the numbering in each poem restarts at 1. To do this, select the desired paragraph style in the list, and click on the Restart button. The paragraph style will be marked with a {RESTART} tag in the list (for an example, see screenshot below). To remove the tag, simply click on the Restart button again.

Screenshot of Line Numbers 3.4.0 Script


Once you have set all the options (which are stored with the document so it is not necessary to set them more than once) simply click on the Replace Numbers buttons. You may also click on the Add Numbers buttons. The difference between these two buttons is as their name suggests: The Replace Numbers button will delete any existing line number frames before applying the new line numbers, whereas the Add Numbers button will simply add a new set of numbers on the page and not delete any previous number frames. Although this behavior can be useful on occasion, you will normally want to use the Replace Numbers button because this avoids inadvertently creating two sets of line numbers on the same page.

To remove numbers from the document, you can click on the Remove Numbers button. Alternatively, you can delete the special layer created by the script (in the Layers panel) to remove all the line numbers throughout the document.


  • To choose the distance you would like the numbers to be from the main text frame, there are two options:
    (1) Via the Line Numbers Object Style. Edit the style: Under the Text
    Frame General Options tab, modify the value of the Right (or Left) Inset
    Spacing field as needed.
    (2) Via the Line Numbers Paragraph Style. Edit the style: Under the
    Indents and Spacing tab, modify the value of the Right (or Left) Indent
    field as needed.
  • Hover the mouse of many of the controls in the dialog box to see a brief explanatory note.

For the technically minded: The script adds a new text frame or text frames alongside the selected frames. In this new text frame it adds the line numbers. The new text frame is placed on a special layer created by the script. The script creates an object style which is applied to the numbers text frame, as well as a paragraph style which is applied to the numbers paragraphs. A new RGB swatch is also created.

You can download a demo version of this script here.

A single license for this script is available at $49 USD. For multiple licenses, please contact us to arrange a discount.

The terms of the license permit the installation of the script on a single user’s computer. The script is copyright. It is illegal to make unauthorised copies of the script.

To purchase the full version for only $49, click the “Buy Now” button, or email us. Your will receive your full, unlocked script normally within one working day.

For just $49, this script is an amazing timesaver for anyone working on long documents in InDesign.

Add Line Numbers to InDesign
Add Line Numbers to InDesign

43 thoughts on “Line Numbers in InDesign

  1. Hi,

    This jai, this script is inserted the line numbers page wise only that means each page has starting with number 1. But my requirement is inserting number continuously for instant my chapter 1 has 30 pages, and line numbers should be every 5 lines have to insert 5, 10, 15, 20, 25, 30, 35, ……). Can u give me the demo script according to my request.

  2. I am creating a document that needs to have line numbers appear every for every 5 lines of text. Using the list function, I want to get a number for every line 5, 10, 15, 20, 25, etc. the line numbers should be follow on continuous page. For instance page 1 has complete with 25 lines, the next page should be continuous with 30, 35, etc.

    Is this possible in your script.

  3. Hi,

    Version 2.0 of the script, due out very soon, will have options for numbering lines at intervals the user selects (5…10…15 or 3…6…9 etc.) as well as several other improvements, including numbering an entire document consecutively (if page 1 ends with line 22, page 2 will begin with line 23 etc.).

    Stay tuned!


  4. Is it (or rather: will it at some point be) possible to only add line numbering to certain styles?

    I want my paragraph styles to be numbered consecutively throughout the story, but NOT headings, lists, or other styles; and they shouldn’t count towards line numbering, either.

    Will that be available at some point, do you think?

  5. Thanks for the suggestion. It is now (version 3.0) available.


  6. Dear Ariel,
    I need to number the lines of a long poem (400 pages) continuously in increments of five. More importantly, I need to be able to suppress the numbering on certain lines that contain rubrics so that it skips those lines (the rubrics are actually bold to distinguish them from the text). The problem can also be seen in terms of numbering paragraphs because each line of verse is separated by a hard return. Finally, I have involved footnotes that can not be affected. Will your script address all of these issues?

  7. I wonder if the script can be enhanced to allow numbering only of selected text. I have a text that needs line numbering item-by-item for short items; imagine a numbered series of short prose texts whose annotation is keyed to line numbers (so the numbers can’t be made a hard part of the text as with poetry). There are several items on a page, and I’d prefer to avoid splitting them each into a separate frame if I can (although I’ve already got a script for that…)

  8. Hi Gregory,

    I think the script will be able to do what you need.

    You can choose exactly which paragraph styles to add numbers to, so if your paragraphs with rubrics can be assigned a different para style to the regular poem text that does need numbers, you can tell the script to number only the poem text and not the paragraphs with rubrics.

    The script should not affect your footnotes.

    At any rate, there is a link to a demo version of the script on the web page, so feel free to try it and see.

    Good luck,

  9. Hi Jeff,

    The script could be enhanced to number the current selection only. It may take me a while to get round to doing that.

    Is there some way you might use the paragraph styles settings to accomplish what you want meanwhile? For instace, you could, even temporarily, apply a unique paragraph style to the text you want numbered. Then, in the script options, select only that unique paragraph style to be numbered, and select “This frame only”. Run the script. Finally, reaaply the original paragraph style to the text.

    Might that work?


  10. Thanks, Ariel.

    That does seem less time-consuming than chopping up frames. I’ll implement that for the time being, but it would be a real time-saver to be able to number selected text.


  11. Hi Ariel,

    Just thought of something else. It would be desirable for the numbers to appear in the fore margin: that is, to the left of text on the left-hand page and to the right on the right-hand page. How can I manage this?


  12. Hi Jeff,

    As we discussed by email, the script does in fact work that way by default!


  13. Hi Ariel,

    this add-on would exactly fit my purpose if it allowed to restart from 1 at each new paragraph in the selected style (or whenever a embedded style appears) : would it be possible?


  14. Hi Yasmine,

    Yes, that should be possible. Good idea for a feature request!

    Contact me at to discuss if you want to take this up further.


  15. The feature Yasmine asked for – to restart numbering based on paragraph style – has now been added (from version 3.3).


  16. It would appear from the image on this web page that version 3.3 of this script seems to be perfect for my needs as an English reader needing at times to number line of poetry or other lines of a prose passage that I need to reference for my students, but I’m not sure how to activate the script for use in InDesign in order to test it. I use a Mac and clicking on the unzipped file (LineNumbers3.3.0.Demo.jsxbin) from my desktop opens a window that asks me to choose what appears to be a programming language. Excuse my computer illiteracy, but I’m lost. Am I supposed to activate this script through InDesign?

  17. Hi Bob,

    To install the line numbers script (and any other scripts on this website), simply put the file LineNumbers3.3.0.Demo.jsxbin into the InDesign scripts folder, and then double click on that file from within InDesign’s script panel to run.

    Here’s an excellent link that explains clearly how to install InDesign scripts:


  18. Well, I’m at a total loss as to understand how this script works, and I’m certainly not going to buy it until I do. I’m trying to add line numbers to a long Victorian poem with seven long cantos, with the numbering beginning with each new canto. I have tried giving the paragraphs of each canto a new paragraph style, but it still does not work.

  19. Hi Alex,

    If I’ve understood correctly, you want the numbering to restart at the beginning of each canto.

    What you need to do is:
    (1) Make sure that the first paragraph of each canto has a special paragraph style (you could call the style “First Para of Canto”).
    (2) Select the first word of the poem, or one of the text frames containing the poem. This will tell the script which text you want to add numbers to.
    (3) Run the Line Numbers script (you can try this with the demo version). In the list of paragraph styles on the left, select all the paragraph styles besides which line numbers should appear.
    (4) Tick the checkbox that says “Restart numbering based on paragraph style”.
    (5) Now, again in the list of paragraph styles on the left, locate the paragraph style you created in step (1) above, and (here’s the tricky part) double-click on it while pressing CTRL-ALT on the keyboard. The word {RESTART} should appear next to the paragraph style name at this stage. This tells the script to restart the numbering whenever it encounters the selected paragraph style.
    (6) Since it sounds like you do not want the numbering to restart each page, but only each canto, deselect the option that says “Restart numbering each page”.
    (7) In the “Add line numbers to what?” box, select the option that says “This Story Only” (if it isn’t already selected).
    (8) Click on replace numbers.

    That’s it. Once the script finishes running, all the poem should be nicely numbered, with the numbering restarting with each canto.

    Good luck. Post back if you have any questions.


  20. Thank you, Ariel.

    This is a little tricky, and not immediately obvious – I still think that it should be a lot easier and quicker to do this in inDesign – but I think I should be able to get it to work from here.

    The instruction about {RESTART} appears to be central to getting it to work correctly and that you just need to style the first paragraph in each section (canto)

    Thanks for your help.

  21. One question, and that is when I resize the text box to which the numbers apply, and resize the numbers to match, the numbers on successive boxes which have not been resized don’t match up. Am I missing some step here?

    At the moment I have to have everything absolutely right and in place before I run the script, and it is very difficult to adjust post facto. Any suggestions?

  22. Incidentally, I have decided to introduce myself to doing the work using the book feature in Indesign which means that each canto is a separate document. It will make the line script a little bit easier too.

  23. Hi Alex,

    I’m not entirely sure I follow your description of the problem, but it seems to me that you needn’t worry about the line numbers. Just adjust the text frame/s as you like, and then rerun the line-numbers script. When you click on “Replace numbers” it will first delete any existing numbers, and then add new ones — and that way everything should align properly.

    Note that you do not need to set all the options in the line numbers script each time you run it: the script remembers your options from the last time.

    Likewise, if you change the formatting of the line numbers by adjusting the line numbers paragraph style, those changes you made will be remembered.


  24. I wanted to thank you, Ariel, for writing a fantastic script and for helping me work out various issues on my side of things. You have been very helpful, courteous, and professional. I sincerely appreciate the work you’re doing!

  25. Thanks Alicia. Much appreciated!

  26. Hi Ariel

    I am very impressed with this script. Can you consider adding the following functionality? Good style for line numbering poetry is to position numbers to the right of the poem on both left and right pages. This also applies to line numbering in an asymmetric layout. Can you add the ability to select inner or outer margins on left and right pages? Also, I sometimes set parallel text editions. It seems that your script will not observe the presence of two stories (one on the left pages for the original language, one or the right pages for the translation) when numbering. Is it possible to correct this? I can send an example.

    Many Thanks


  27. Hi Ariel,

    thanks for your wonderful script. I’m looking for an option to change on which side of the document the line numbers appear. Currently the line numbers appear on every page on the right-hand side but I need them on the left so I have to manualy drag them from one side to another.

    Thanks in advance

  28. Hi Rene,

    Thanks for your comment. The script normally puts the numbers in the outside column, so on the right-hand page they will be in the right outside margin, and on the left-hand page they will be in the left outside margin.

    Is this not what’s happening for you?

  29. Hi Ariel,

    thanks for your reply. Thas exactly what’s happing, but basiclly I’m working on single sided documents. Not as you mentioned on double paged documents. So it looks like all my pages/spreads are right handed. Didn’t find an option in InDesign to change the binding from left to right.


  30. I see. Yes, you’re not the first who’s asked for this option. I’ll try and add it to the script.

    Meanwhile, if it’s urgent for you, I can make a temporary hard-wired solution for you. Send me an email (via the Contact page).

  31. To Paul, Rene and anyone else who needs this option:

    Line Numbers version 3.4.0 is now available. The user can now choose where to place the line numbers:

    (a) In the outside margin of the page (left margin for the left page, right margin for the right page);

    (b) Always in the left margin; and,

    (c) Always in the right margin.

  32. Hi Ariel: I just bought your script last week, and I see you added a feature that I DO need. How to I get the updated script? I need the numbers to the left of the text on both pages, as you describe below.

    thank you!


  33. Hi Lori. I just sent you the updated version.

  34. We just purchased the line-numbering script and it’s wonderful! Our templates have wide (about 2 inch) left margins on both right and left pages. The places the line numbering text frame right next to the main text frames on the left so the numbering is about 3/8 inch to the left of the main text flow. So the script places the text frame in the left margin — quite a distance from where our manual text numbering goes. Is there a way to tweak the script so that the line-numbering text frame is positioned where our template calls for it?

  35. Hi Penelope,
    I think I’ve understood what you’re asking, but a screenshot would really help. Could you send me a screenshot so I can take a look and see what can be done? Please send it to admin (at)


  36. Thanks for your quick response. I’ve sent you a screenshot with a bit more explanation.

  37. Hi Ariel!
    I would like to buy the script. Is it possible to place the Numbers “inside margin”?

  38. Hi Stefan,

    I seem to have overlooked that option! Let’s put it this way: By the time you buy the script, it will be possible — guaranteed 😉

    (PS The inside-margin placement option is now available in version 3.4.2)

  39. Ariel,

    This script is great. Wonderful work. The only thing keeping me from buying it is the option to start numbering at a specified number. For instance, I need to be able to begin numbering at line 5 and then number every 10th line from there. So 5, 15, 25, 35, 45, etc.


  40. Hi Jamie,

    Not quite possible in the current version 3.4.5, but very easy to do on my end. I also think it’s an excellent feature request. So what I can do if you make the purchase, is: (a) send you the regular full script; (b) send you a custom-made version hardwired to do what you want (5, 15, 25 etc.); (c) when I get round to adding this feature to the UI, hopefully soon, I’ll send out a free upgrade.


  41. Does anyone know how to set the line numbers up so it skips blank lines and continues with the numbering sequence?

  42. Can you make number line start on the number I choose?
    I have an InDesign that is in 2 files because of it’s size. I want to stary the 2nd file”s number line to start at the next number numerical at the start of the 2nd file.

  43. Hi Pam,

    Unfortunately, this is not possible right now. However, it makes sense as a feature request, so I will definitely put it on the “To Do” list…

Leave a Reply

Your email address will not be published. Required fields are marked *