Convert Morse code to a timed light signal pattern
Turn written Morse code into a light-ready timing sequence without calculating every flash and pause yourself.
Run — free
Enter dots and dashes, separate letters with spaces, place a slash between words, and choose the duration of one timing unit in milliseconds. The converter returns each on and off event in order, along with useful duration totals. It follows the familiar Morse proportions for dots, dashes, symbol gaps, letter gaps, and word gaps, while rejecting characters that do not belong in Morse input.
Write the Morse input with clear separators
Enter each encoded letter as one uninterrupted group of dots and dashes. Put whitespace between letter groups and use a forward slash between words. For example, the familiar distress signal is written as ... --- ..., while two words might look like .... .. / - .... . .-. .. Spaces around the slash are optional because the converter normalizes them in its result. The input is intentionally strict about its alphabet: only dots, dashes, whitespace, and the slash word separator are accepted. A letter is not checked against a dictionary of assigned Morse characters, because the job here is to time the supplied pulse pattern, including procedural or custom sequences. However, an unrelated character such as an asterisk, letter, digit, or underscore produces an input error with its position. Empty words and a slash at either end are also rejected, preventing an ambiguous silent interval from entering a device schedule. This makes the accepted notation compact enough to paste from an encoder while remaining predictable for automation.
Understand how the timing units become milliseconds
Choose unit_ms as the duration of a single Morse unit. Every dot keeps the light on for one unit, and every dash keeps it on for three. A pause of one unit separates adjacent symbols inside the same letter. A pause of three units separates letters, and a pause of seven units separates words. With a 100 millisecond unit, a dot is therefore 100 milliseconds on, a dash is 300 milliseconds on, and a word gap is 700 milliseconds off. The returned sequence is chronological and uses explicit on and off records, so a program can process it from the first item to the last without interpreting punctuation again. There is no trailing off record after the final symbol: the output describes the signal itself, not an arbitrary amount of silence after it finishes. Durations use integer multiplication, and the unit must be a whole number from 1 through 60,000 milliseconds. Those rules keep every reported duration exact and suitable for timers that accept millisecond values.
Use the sequence in lights, previews, and tests
The event list is useful anywhere a Morse pattern must cross from text into timing logic. A microcontroller script can iterate over the records, set an LED to the requested state, and wait for duration_ms before advancing. A browser preview can use the same list to animate a lamp icon, while an accessibility project can transform on events into vibration or audio without changing the spacing. Alongside the sequence, the result reports the normalized Morse notation, event count, accumulated on time, accumulated off time, and complete duration. Those totals help you size an animation, compare sending speeds, or assert that an implementation has preserved the intended rhythm. Hardware and operating-system timers can introduce scheduling latency, so the converter does not promise physical transmission precision; it supplies the ideal deterministic schedule. It also does not translate ordinary language into Morse. If you begin with letters or words, encode them first, then pass the resulting dots and dashes here to obtain the light pattern.
What you can do with it
Drive an LED controller
Convert a stored Morse message into ordered on/off waits that firmware or a hardware-control service can execute.
Build a visual Morse preview
Animate a lamp, beacon, or screen element with exact relative timing before deploying the pattern to a physical device.
Test signal timing code
Compare an application's generated events and duration totals against a deterministic reference schedule.
FAQ
What does it cost?
The API price is $0.002 per item, and the browser version can run locally on this page.
What timing standard does the converter use?
A dot is one unit, a dash is three, an intra-character gap is one, a letter gap is three, and a word gap is seven.
How should I separate letters and words?
Use one or more whitespace characters between encoded letters and a forward slash between words.
Does it convert normal text into Morse code?
No. It converts existing dot-and-dash notation into timing events; encode ordinary text before using this capability.
Why is there no final off duration?
The last symbol ends the defined message. Any silence after it belongs to playback or repetition policy, not to the Morse pattern itself.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/enc/morse-light-pattern \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"morse":"... --- ...","unit_ms":100}'const res = await fetch("https://api.kit.forhosting.com/enc/morse-light-pattern", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"morse": "... --- ...",
"unit_ms": 100
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/enc/morse-light-pattern",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"morse": "... --- ...",
"unit_ms": 100
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/enc/morse-light-pattern", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"morse":"... --- ...","unit_ms":100}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"morse":"... --- ...","unit_ms":100}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/enc/morse-light-pattern", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"morse": "... --- ...",
"unit_ms": 100
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "enc.morse_light_pattern",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_characters | 10000 |
max_unit_ms | 60000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |