How to change the default app for .md files on a Mac

To open every .md file in one app, use Finder's Get Info window and click Change All. Select any .md file, press ⌘I, choose the app under "Open with", then click "Change All…" and confirm. From then on, double-clicking any .md file opens it in that app.

Steps: make a Markdown app the default

These steps work for any app. The example uses Pagewide, a Markdown viewer.

  1. In Finder, select any file that ends in .md.
  2. Choose File › Get Info, or press ⌘I.
  3. In the Get Info window, open the Open with section and choose Pagewide from the pop-up menu.
  4. Click Change All…, then click Continue to confirm.

The change applies to every file of that kind, on that Mac, for your user account.

Other Markdown extensions may need their own change

Change All covers every file of the same kind. Markdown files also come as .markdown, .mdown and .mkd, and as R Markdown .rmd and Quarto .qmd, and depending on the apps you have installed, macOS may treat some of these as a different kind. If any still open in another app, repeat the steps once with a file of that kind. The guide to Markdown file extensions lists them all.

Open one file in a different app

To open a single file in another app without changing the default, Control-click it in Finder and choose Open With. Hold ⌥ Option while the menu is open and it becomes Always Open With, which remembers the app for that one file only.

You can also drag the file onto an app's icon in the Dock.

Undo it

Repeat the same steps and choose a different app, for example TextEdit, then click Change All… again. There is no separate reset button: the default is whichever app you chose last.

If Pagewide isn't in the list

The Open with menu lists apps that say they can open the file. If Pagewide is missing, make sure it is in your Applications folder and has been opened once. If it still doesn't appear, choose Other… at the bottom of the menu and pick Pagewide in Applications.

Questions

Why do my .md files open in Xcode?

Installing Xcode makes it a handler for many text files, and macOS may pick it for .md files. Change the default in Get Info, as above, to open them somewhere else.

Does changing the default app change my files?

No. The default app is a setting on your Mac. The files themselves stay exactly the same, and other people's Macs keep their own settings.

Can I keep editing in one app and reading in another?

Yes. Set your reader as the default for double-click, and open files in your editor from the editor itself or with Open With. Pagewide reloads the page whenever the file is saved, so the two work side by side.

References

  1. Apple, Choose an app to open a file on Mac.

Next: how to open and read .md files on a Mac, or reading a whole folder of Markdown.