How our encoder is implemented
The core is src/lib/morse.ts in the open-source repo — a pure TypeScript function with no dependencies. The function is unit-tested against every letter of the ITU alphabet, every digit, and the full punctuation set. The same engine powers every other translator on Morsify, so output from this page is byte-identical to what you'd get anywhere else on the site.
If you're a developer: the logic is under an MIT-compatible licence on GitHub. It's about 40 lines and easy to drop into any JS/TS project without the overhead of a library.
Output format contract
- Dots are
., dashes are-. No Unicode middle-dots or em-dashes. - Inter-letter separator: single space.
- Inter-word separator:
/(space, slash, space). Standard convention from the ITU-R M.1677 recommendation. - No trailing whitespace. A trimmed output, safe to paste anywhere.
- Case-insensitive input — everything is uppercased before the lookup, so
morseandMORSEreturn identical output.
Common use cases
- Puzzle and game design. Encoding a clue into morse for escape rooms, ARGs, or geocaching.
- Art and print projects. Generating the pattern to typeset a morse-code poster or merchandise.
- Ham radio study aids. Producing drill text at a target WPM to train against.
- Software integrations. Fetching an encoded string for a chatbot, CLI, or sensor demo.
Edge cases the encoder resolves for you
- Unknown characters. An emoji, a curly quote, or a letter outside the ITU table is dropped rather than encoded as a placeholder, so you never ship a string with stray question marks in it.
- Runs of spaces. Multiple spaces between words collapse to a single word separator, which keeps the output free of empty
/ /gaps that would confuse a decoder. - Mixed case and digits.
SOS 2025encodes cleanly —... --- ...for the letters, then each digit in full (2 is..---, 0 is-----), with word separators exactly where the spaces were.
What the encoded string does not carry
An encoder gives you the symbols — dots, dashes, and separators — but morse is really a timing code, and timing lives in the playback, not the text. The string - tells you “dash,” but whether that dash lasts a fraction of a second or a full second depends on the words-per-minute you play it at. That is why the same encoded output can be sent at 5 WPM for a beginner or 30 WPM for a contest operator: the encoder fixes the pattern, and the speed is a separate dial you set when you turn the string into sound, light, or vibration.