Nick R.J. Blog

May 5 2026 - macOS Can Natively Deshittify the Web, Almost

Recently I've been trying to deshittify the modern web by archiving websites into extremely plain HTML and viewing that instead.

Turns out macOS can natively do this, assuming you're only trying to archive text content. Here's how to do it:

1. Copy any text you select from a web browser to the clipboard
2. Paste this text into TextEdit
3. Under 'HTML Saving Options' in 'TextEdit > Settings > Open and Save':
  • Set 'Document type' to 'HTML 4.01 Strict'
  • Set 'Styling' to 'No CSS'
  • Set 'Encoding' to 'Unicode (UTF-8)'
  • Disable 'Preserve white space'
4. Save the file with the file format 'Web Page (.html)'

Enjoy a pristine webpage, no garbage whatsoever! Check the page source, it's incredibly clean. You can try it out with this webpage.

This works because macOS actually copied the HTML, not just the plain text on a webpage. When pasted into TextEdit, this HTML gets converted to an NSAttributedString in Swift, which strips out all of the garbage in the HTML.

This process isn't perfect, though. Depending on how the webpage was styled, some formatting might be lost. It's worth double-checking the output. If you used this webpage as an example, note that the <hr> tag below wasn't included in the output.


The biggest problem with this process is that it does not natively support images/videos/audio.

It's possible to support media, and I have a solution for it, but it's more complicated. It involves writing a browser extension and a Swift program.

The browser extension saves all media on a webpage to Data URLs and converts them to <a> tags as placeholders. The Swift program replicates the needed functionality of TextEdit, and also replaces every placeholder on the webpage with an <img>, <video>, or <audio> tag. It works well, but I can't say it's very user-friendly.

If you have a better solution, please let me know! If any media is pasted into TextEdit, the only options for saving are 'Rich Text Document with Attachments' and 'Web Archive Document.' I don't see a way around this. I'd prefer a zero-code solution.


More posts