My .org file is almost 2MB large. How can I narrow down what headers/sub-headers take so much space?

  • 1
    In case it's due to many lines of content, then a really trivial approach is to enable display-line-numbers-mode with only the headings visible, and look for a really big jump. Then expand/repeat as necessary to drill down. To check actual character counts, you may need to write some code -- more or less just checking how much (point) changed between each heading, and maybe showing that as a proportion of (point-max).
    – phils
    Commented Apr 1, 2020 at 0:14
  • @jagrg Post as answer please
    – jjk
    Commented Apr 27, 2020 at 6:58

2 Answers 2


See org-treeusage.el. It was added recently to the MELPA archive.

This library provides a minor mode for peeking at the line or character usage of each heading in an org-mode file with respect to the parent heading, allowing users with large org files to see the distribution of heading content and make informed decisions on where to prune, refile, or archive.


You can use the Python script org-du to produce line counts per section, using the same format as the du command line tool. This can then be piped to xdu for a graphical display.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.