How does one change the tabstop in TextEdit.app for Snow Leopard?

The current tabstop is 8 spaces. I would like to change this to 4 spaces.
Is there any way to achieve this?



  1. Make sure Format > Text > Show Ruler is enabled.
  2. Locate the tab stops in the ruler (Fig. 1).
  3. Move the first one to 1/4 inch (Fig. 2).

Fig1 Fig2 Alternatively, you could use something like Keyboard Maestro, TextExpander, or BetterTouchTool to map four spaces to the Tab key. This is the only way I'm aware of to do it for plain text files (.txt).

  • 2
    If your document has existing content, select all of the content before making this adjustment so the tab stops are applied to all of the paragraphs. – bneely Feb 11 '12 at 21:24
  • 6
    This works for rich text documents. It seems not to show a ruler for plain text documents. I'll keep this in mind. Thanks! – phwd Feb 11 '12 at 21:52
  • 1
    Oh, sorry, didn't realize it didn't work for .txt files. Oh well! – Tuesday Feb 12 '12 at 1:24
  • @phwd Added an alternative for .txt files. :) – Tuesday Apr 4 '12 at 20:49
  • Sweet looking into them now – phwd Apr 4 '12 at 20:55

For plaintext tabs, you don't need to replace the entire TextEdit app to change it. I looked at the source code and it provides the simpler answer: Open the Terminal and type

defaults write com.apple.TextEdit "TabWidth" '4'

Where '4' is the number of spaces a tab should be.

  • 4
    Fantastic, I basically only use it in plaintext mode anyways. Would upvote more if I could :) – Johannes Mar 11 '15 at 8:56
  • Nice! Worked perfectly! – DaveyJake Aug 5 '15 at 2:36
  • this should be a selected answer. – Vivek Sharma May 26 '17 at 13:34
  • @liquid, You looked at the source code? Textedit is opensource? – Pacerier Oct 9 '17 at 11:34
  • 1
    Why in the world is the default 8 spaces? That seems way to large in my opinion. The default should be 4. Does anyone else agree? I'd be curious to know what other people think. – Peter Schorn Feb 13 '20 at 4:37

A kindly soul has slightly modified TextEdit to add a field, "Tab Width", at the bottom of the "New Document" tab of the "Preferences" window.

Type in a number between 1 and 100 (inclusive) and it will change the width of tabs to that number (in character widths).

Download at code.google.com.

Since I couldn't replace the main TextEdit app, I used "show package contents" and replaced the inside of the app.


TextEdit bases its tabs on distances, not number of characters.

If I set the text to 30pt, the tabs are four spaces. At 14pt, they are eight spaces.

Consequently, there is no set "number of spaces" that could ever be modified.

One solution is to:

  1. change your font preferences for RTF files to match my TXT preferences.

  2. temporarily convert your TXT files to RTF while editing (cmd-shift-T).

(do some editing)

  1. convert back to TXT when you quit (cmd-shift-T).

The RTF tabs default to 4 spaces for me -- it depends on the font and size.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .