String obfuscator

Obfuscate a string (like a secret, an IBAN, or a token) to make it shareable and identifiable without revealing its content.

loading String obfuscator
About this tool

What is a string obfuscator?

A string obfuscator hides part of a text by replacing characters with a mask, usually *. You keep the first few characters, the last few, or both, and everything in between is masked: 4111111111111111 becomes ************1111, maria.silva@example.com becomes ma•••••••••@example.com. People call it text masker, string masking, redact text or hide characters tool.

It is for display, not for secrecy. Typical uses: redacting an email address, a token, a card number or a phone number before pasting it in a bug report, a support ticket, a screenshot, a log excerpt or documentation; showing only the end of an API key so a person can recognise it (api_key_**************); preparing examples for a tutorial without exposing real data; or building the masked version of a value for a user interface mock-up.

Obfuscation here is a one-way mask and not encryption: the hidden characters are replaced, not encoded, so nobody can recover them from the result, and you cannot recover them either. The tool works with whole characters (code points), so an emoji counts as one position, keeps line breaks and tabs when "keep spaces" is on, and warns you when more than half of the text stays readable, which defeats the purpose for short secrets. Everything runs on your device; the text you type is not sent anywhere.

How to obfuscate a string

  1. Type or paste the text in the input box. A sample sentence is loaded at first.
  2. Set Keep first to the number of characters at the start that stay visible (the default is 4).
  3. Set Keep last to the number of characters at the end that stay visible (the default is 0).
  4. Choose the mask character: * by default, or any other character such as • or #.
  5. Decide whether to keep spaces: with it on, spaces and line breaks are left as they are, so words keep their shape; with it off they are masked too.
  6. Copy the obfuscated result. If the tool warns that more than half of the text is visible, lower the keep values.

Examples

The default sample

Lorem ipsum dolor sit amet with keep first 4 and spaces kept:

Lore* ***** ***** *** ****

A card number

4111111111111111 (a well-known test number) with keep first 0 and keep last 4:

************1111

Payment-card standards limit how much of a card number may be displayed; see the PCI Security Standards Council for the exact rule that applies to you.

An API key prefix

api_key_8f3a91c2d7e4b6 with keep first 8:

api_key_**************

An email address

maria.silva@example.com with keep first 2, keep last 12 and the mask •:

ma•••••••••@example.com

A phone number

(11) 98765-4321 with keep first 0, keep last 4 and spaces kept:

**** ******4321

Note that punctuation is masked too, because only spaces are preserved.

Common mistakes

  • Treating the mask as encryption. It hides characters in the output; keep the original safe separately. If you need to protect data in storage, use encryption.
  • Keeping too much. With short secrets, "keep first 4" and "keep last 4" can show everything. The tool warns when more than half is visible.
  • Hiding the wrong end. For emails you usually keep the domain; for cards the last four digits.
  • Counting positions wrong. Spaces kept on purpose are not counted as positions; if you turn off "keep spaces" they are.
  • Masking only on screen. A screenshot of a text editor can still contain the original in the file or the clipboard history.
  • Using one-character masks that reveal length. The mask has the same length as the original. For passwords, show a fixed number of dots instead.

Frequently asked questions

Is obfuscation the same as encryption?

No. Encryption can be reversed with a key. Masking removes the information, so it cannot be reversed from the result.

How do I hide part of an email or phone number?

Keep the first or last characters you need and mask the rest, for example keep first 2 and keep last 12 for an email.

Can I use an emoji or another symbol as mask?

Yes, use any single character. If you type several, the first one is used.

Does it send my text anywhere?

No, it runs in your browser.

How do I protect data permanently?

Masking is for display. For storing secrets use encryption or a hash; see the hash generator.

Report a problem