Morse Code Decoding: From Basics to CTF Use Cases
2026-06-09 · 5 min read
Figure 1: Morse Code Decoding
What is Morse Code?
Morse code is a communication method that represents each letter, digit, and punctuation mark as a sequence of short and long signals, traditionally written as dots and dashes.
It was developed in the 1830s and 1840s by Samuel Morse and Alfred Vail for use with the electric telegraph. It allowed text messages to be sent as electrical pulses over long distances.
Morse code is still used today in aviation, amateur radio, and emergency signaling. It also appears regularly in CTF challenges, puzzles, and steganography tasks.
How Morse Code Works
Each character in Morse code is made up of:
- Dot (.) - A short signal
- Dash (-) - A long signal, three times the length of a dot
Characters are separated by a short pause. Words are separated by a longer pause.
The Morse Code Alphabet
| Letter | Code | Letter | Code |
|---|---|---|---|
| A | .- | N | -. |
| B | -... | O | --- |
| C | -.-. | P | .--. |
| D | -.. | Q | --.- |
| E | . | R | .-. |
| F | ..-. | S | ... |
| G | --. | T | - |
| H | .... | U | ..- |
| I | .. | V | ...- |
| J | .--- | W | .-- |
| K | -.- | X | -..- |
| L | .-.. | Y | -.-- |
| M | -- | Z | --.. |
Morse Code Digits
| Digit | Code |
|---|---|
| 0 | ----- |
| 1 | .---- |
| 2 | ..--- |
| 3 | ...-- |
| 4 | ....- |
| 5 | ..... |
| 6 | -.... |
| 7 | --... |
| 8 | ---.. |
| 9 | ----. |
Decoding a Morse Code Message
To decode a Morse code message:
- Split the message by single spaces to get individual character codes.
- Split by double or triple spaces to identify word boundaries.
- Match each code to the Morse alphabet table.
- Write the corresponding letter or digit.
Example:
Input:
.... . .-.. .-.. --- .-- --- .-. .-.. -..
Decode each group:
- .... = H
- . = E
- .-.. = L
- .-.. = L
- --- = O
- (word break)
- .-- = W
- --- = O
- .-. = R
- .-.. = L
- -.. = D
Result: HELLO WORLD
Encoding a Message in Morse Code
To encode text into Morse code:
- Take each letter of your message.
- Look up its Morse code sequence in the alphabet table.
- Place a single space between characters and a longer gap (shown as three or more spaces, or a slash) between words.
Example:
Input: SOS
- S = ...
- O = ---
- S = ...
Morse output:
... --- ...
SOS is one of the most recognized Morse code sequences because of its use as an international distress signal. It was chosen for its simplicity, not because the letters spell anything specific.
Morse Code in CTF Challenges
Morse code appears often in CTF competitions across multiple categories.
Common CTF scenarios:
- A text file or challenge description contains dots and dashes that decode to a flag.
- An audio file contains beeps at different lengths representing a Morse message.
- A binary image uses dark and light pixels or patterns to encode Morse signals.
- A string uses alternative characters like 0 and 1, or underscores and hyphens, instead of dots and dashes.
- Morse is used as one layer of a multi-stage encoding challenge.
How to recognize Morse code in a CTF:
If you see a string containing only dots, dashes, and spaces, Morse code is the first thing to try. Also look for patterns using two alternating characters where one appears far more often than the other, as this resembles the dot and dash frequency distribution.
Audio-based Morse code:
In audio challenges, Morse is transmitted as short and long beeps. A short beep is a dot. A long beep is a dash. Use an audio editor or a Morse decoder app to analyze the signal.
Image-based Morse code:
Some CTF challenges encode Morse in pixel rows or column patterns. Analyze the image data and map light and dark regions to dots and dashes.
Alternative Morse Code Representations in CTFs
CTF authors sometimes replace the standard dot and dash notation with other characters to add difficulty.
Common substitutions:
| Morse Symbol | Common Substitutes |
|---|---|
| Dot (.) | 0, *, short, i, 1 |
| Dash (-) | 1, _, long, a, 0 |
| Space | /, |
If you see a two-character pattern that does not look like Morse at first glance, try mapping the two characters to dot and dash.
Decode Morse Code Online
You can decode Morse code messages instantly at KeyDecryptor Morse Decoder.
Steps:
- Paste your Morse code string using dots and dashes.
- Click Decode to get the plain text result.
The tool supports both standard Morse code and common alternate formats.
Morse Code Timings for Audio Analysis
When working with audio-based Morse code:
| Element | Duration |
|---|---|
| Dot | 1 unit |
| Dash | 3 units |
| Gap between elements | 1 unit |
| Gap between characters | 3 units |
| Gap between words | 7 units |
These ratios help when manually analyzing audio waveforms or spectrogram data.
Frequently Asked Questions
Is Morse code encryption?
No. Morse code is encoding, not encryption. It has no key and anyone who knows the alphabet can decode it. It was designed for communication efficiency, not secrecy.
Can Morse code represent all languages?
Standard Morse code covers Latin letters, digits, and common punctuation. Extended versions exist for other scripts, including Arabic, Japanese Wabun, and Korean, each with their own coding tables.
How fast can Morse code be transmitted?
Skilled operators can send and receive Morse at 20 to 30 words per minute. Competitive operators can exceed 60 words per minute.
What does SOS mean in Morse code?
SOS in Morse code is ... --- ... (three dots, three dashes, three dots). It was adopted as the international distress signal in 1908 because the pattern is easy to recognize even in poor conditions. The letters do not stand for any phrase in the official standard.
Why does CTF Morse code sometimes use slashes?
Slashes (/) are commonly used to represent word breaks when the challenge is written as a single line. A single slash separates letters and a double slash separates words, though conventions vary by challenge author.