Transform - Encoding

Free Morse Code Encode API Endpoint

The free Morse code encode API endpoint turns text into International Morse code: dots and dashes for each letter, one space between letters and a slash between words. Put the text in the URL or post it. A character without a code is listed in the answer, never guessed.

  • No API key
  • International Morse
  • GET or POST
  • Æ Ø Å

Text to Morse

GET/morse_encode/{text}

POST/morse_encode

https://aisenseapi.com/services/v1/morse_encode

Call the free Morse code encode API endpoint

Put the text in the path:

curl https://aisenseapi.com/services/v1/morse_encode/SOS
{"morse_encoded_data":"... --- ...","skipped":[]}

Or post it, for longer text or text that should stay out of the URL:

curl -X POST https://aisenseapi.com/services/v1/morse_encode \
  -H "Content-Type: application/json" \
  -d '{"data": "Hello, world!"}'
{"morse_encoded_data":".... . .-.. .-.. --- --..-- / .-- --- .-. .-.. -.. -.-.--","skipped":[]}

The other way is the Morse decode API endpoint.

Try it

Encode text here. Your browser sends it in a JSON body, as the quick start does. Leave secrets and personal data out.

The code

International Morse code as ITU-R M.1677-1 sets it out, with the marks ! & ; _ $ that are in common use and the letters beyond A to Z that Nordic and other European languages need. Letters are encoded whatever their case.

CharacterCodeCharacterCodeCharacterCodeCharacterCode
A.-B-...C-.-.D-..
E.F..-.G--.H....
I..J.---K-.-L.-..
M--N-.O---P.--.
Q--.-R.-.S...T-
U..-V...-W.--X-..-
Y-.--Z--..0-----1.----
2..---3...--4....-5.....
6-....7--...8---..9----.
..-.-.-,--..--?..--..'.----.
/-..-.(-.--.)-.--.-:---...
=-...-+.-.-.--....-".-..-.
@.--.-.!-.-.--&.-...;-.-.-.
_..--.-$...-..-Æ.-.-Ø---.
Å.--.-Ä.-.-Ö---.Ü..--
É..-..Ñ--.--Ç-.-..À.--.-

Ä and Æ share a code, as do Ö and Ø, and À and Å. A dot is the unit of time: a dash lasts three units, the gap inside a letter one, the gap between letters three and the gap between words seven.

Input and answer

  • GET /morse_encode/{text} takes the text as one path segment, percent-encoded: a space as %20, a slash as %2F, å as %C3%A5. The server turns away a path with two dots in a row, so text such as Wait... goes in a POST.
  • POST /morse_encode takes {"data": "..."} with Content-Type: application/json, or the text as the raw request body with any other type. At most 64 KiB, in UTF-8.
  • A run of spaces, tabs or line breaks is one word gap, written / . Spaces at the ends are left out.
  • morse_encoded_data is the code. skipped lists each character without a code once, at most 32 of them; invisible marks such as the selector after an emoji are left out without being listed.
curl -X POST https://aisenseapi.com/services/v1/morse_encode \
  -H "Content-Type: application/json" \
  -d '{"data": "Call 112 #now"}'
{"morse_encoded_data":"-.-. .- .-.. .-.. / .---- .---- ..--- / -. --- .--","skipped":["#"]}

Errors

StatuserrorWhen
400No text to encode in Morse.No text in the path, no data string and no body
413Text over 64 KiB.More than 64 KiB of text in one request
400The data is not UTF-8 text.Bytes that are not UTF-8
400Nothing in the text has a Morse code.Only characters without a code; skipped lists them

Each refusal also carries fix, a sentence saying what to send instead.

Common uses

Learning and practice

Turn practice words and call signs into code to read or key, and check what a learner wrote.

A message by light or sound

Encode a short message, then flash a lamp or sound a buzzer by its dots and dashes, a dot as one unit of time.

Puzzles and games

Hide a clue in dots and dashes for an escape room, a treasure hunt or a game level.

Agents

Through the MCP server the same encoder is encode_data with the format morse.

Privacy and limits

Nothing is stored. The Morse encode answer is worked out while the request is open and the text is gone with it. The access log records the path and the status. A text sent in the path is part of that path, so post it when it should not be logged.

The base URL is https://aisenseapi.com/services/v1. There is no key, no account and no sign-up step. An encode takes at most 64 KiB of text and a decode at most 512 KiB of code, and the service-wide limit is 5000 requests per IP address per day. Every endpoint in the collection is listed on the Free public REST APIs reference, and the encodings side by side on Encoding APIs.