# How to Remove Invisible Characters from ChatGPT Text on Mac

Updated: November 15, 2026

- [Pure Paste](https://sindresorhus.com/pure-paste.md): Paste as plain text by default. Price: $4, one-time purchase. Platforms: macOS. Get it from: [App Store](https://apps.apple.com/app/id1611378436). Requires macOS 26 or later. Free older versions for macOS 15, 14, 13, and 12: [download](https://sindresorhus.com/pure-paste#older-versions). The app cannot connect to the internet. It has no network permission, so the macOS app sandbox stops all its connections.

URL: https://sindresorhus.com/guides/remove-invisible-characters-mac

Turn on “Remove invisible characters” in the “Extras” settings of [Pure Paste](https://sindresorhus.com/pure-paste.md). Then each text that you copy, like an answer of ChatGPT, has no zero-width spaces or other hidden characters when you paste it. Without an app, clean the clipboard one time with a command in the Terminal app.

Text from AI chatbots, like ChatGPT and Claude, can have invisible characters. Text from web pages and PDF documents can have them too. You cannot see them, but they can break the text in other apps.

## With Pure Paste

1. Open [Pure Paste](https://sindresorhus.com/pure-paste.md). Its icon is in the menu bar.
1. Click the icon, choose “Settings…”, and click “Extras”.
1. In “When clearing formatting”, turn on “Remove invisible characters”.
1. Copy the text, and paste it. Pure Paste removed the invisible characters when you copied the text.

Pure Paste removes zero-width spaces and joiners, direction marks, line and paragraph separators, and control characters that cause problems. It keeps accents (like “café”), normal spaces, tabs, and new lines. An emoji that is made of more than one emoji, like 👨‍👩‍👧, becomes separate emoji, as the joiner between them is an invisible character too.

Pure Paste cleans text only while “Automatically clear formatting” is on (it is on by default), and not in the apps in the “Exclude” settings. [How to paste without formatting.](https://sindresorhus.com/guides/paste-without-formatting-mac.md)

## Without an app

To clean the text on the clipboard one time, copy the text, and run this command in the Terminal app:

```console
pbpaste | perl -CSD -pe 's/[\x{200B}-\x{200D}\x{2060}\x{FEFF}]//g' | pbcopy
```

It removes the zero-width spaces and joiners, and puts the clean text back on the clipboard as plain text. Then paste it.

This is good for one text. Pure Paste does it for each text that you copy, and it removes more types of invisible characters.