---
title: "Morse code"
description: "Letters and digits to dots and dashes. A space between letters, a slash between words."
canonical_url: "https://ciphers.agntn.dev/ciphers/morse"
---
# Morse code

> Letters and digits to dots and dashes. A space between letters, a slash between words.

<cipher-facts name="morse">



</cipher-facts>

International Morse. Each letter or digit becomes dots and dashes, letters separated by one space, words by `/`. Common punctuation has a code too. A character without one passes through as it is.

```ts
const morse = create("morse");
morse.encode("SOS").text; // "... --- ..."
morse.encode("SOS HELP").text; // "... --- ... / .... . .-.. .--."
morse.encode("A, B?").text; // ".- --..-- / -... ..--.."
morse.decode("... --- ... / .... . .-.. .--.").text; // "SOS HELP"
```

Decoding doesn't care about extra spaces around the slash. Output is uppercase, Morse has no case.


## Sitemap

See the full [sitemap](https://ciphers.agntn.dev/sitemap.md) for all pages.
