Mac guide

How to change the default app for text (.txt) files on Mac

Works on macOS Sonoma, Sequoia and Tahoe.

.txt is plain text with no formatting. A Mac opens .txt files in TextEdit. If you live in a code editor, you probably want notes, logs and READMEs to open there too.

Change it in Finder

  1. In Finder, select any .txt file.
  2. Choose File → Get Info, or press ⌘ I.
  3. Expand Open with and pick the app. If it isn't listed, choose Other….
  4. Click Change All… and confirm.

Without Change All…, only that one file changes. Since macOS 26.4, Finder also asks you to confirm before a file-type default changes.

Apps that open text (.txt) files on Mac

Changing .txt does not change other text files

macOS knows that .md, .json, .log, .csv and source files are all kinds of text, but each has its own default. Setting an editor for .txt leaves the rest where they were, which is why a new editor never seems to take over everything.

Change it from Terminal

The free command-line tool duti sets defaults without Finder. Install it with Homebrew:

brew install duti

Then, to make Visual Studio Code open every .txt file:

duti -s com.microsoft.VSCode .txt all

The first argument is the app's bundle identifier. To find it for any app:

osascript -e 'id of app "Visual Studio Code"'

macOS may still ask you to confirm the change.

macOS identifies this file type as public.plain-text.

Change it in Defaultify

  1. Open Defaultify and choose Documents & Office, or search for .txt.
  2. On the Text Files (.txt) row, open the app menu and choose the app you want.
  3. Confirm in the Finder dialog.

This type can be changed in the free version. You can also drag any file onto the Defaultify window to see what opens it.

Manage every default in one place

Defaultify for Mac shows all your file-type and link defaults in one window, flags missing ones, and with Pro warns you when an app takes one over.

Get Defaultify for Mac

If it changes back

Some apps claim file types again when they update. See how to stop apps from changing your defaults, and what to check when a change doesn't stick.

Related guides