Morse code translator

Translate text to international Morse code and back, with "/" between words.

Input

The text to translate, or Morse code written with dots and dashes.
Encode text to Morse, or decode Morse to text.

Result

Fill in the input and press Run.

Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.

Use it from code or an agent

curl -s https://setget.net/v1/tools/morse \
  -H 'Content-Type: application/json' \
  -d '{"input":{"text":"SOS"}}'
import json, urllib.request

body = {'input': {'text': 'SOS'}}
request = urllib.request.Request("https://setget.net/v1/tools/morse", json.dumps(body).encode(),
                                 {"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/morse", {
  method: "POST",
  headers: {"Content-Type": "application/json"},
  body: JSON.stringify({"input":{"text":"SOS"}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
  "slug": "morse",
  "input": {
    "text": "SOS"
  }
}
{
  "input": {
    "text": "SOS"
  }
}

Endpoint: POST /v1/tools/morse. Over MCP: run_tool with slug: "morse". Machine-readable: input schema, Markdown. Connect an agent.

Inputs

NameTypeRequiredWhat it does
text string yes The text to translate, or Morse code written with dots and dashes.
action string no Encode text to Morse, or decode Morse to text. One of: encode, decode. Default: "encode".

Examples

Input
{
  "text": "SOS"
}
Result
{
  "text": "... --- ...",
  "unknown": []
}

Words are separated by a slash

Input
{
  "text": "Hello World"
}
Result
{
  "text": ".... . .-.. .-.. --- / .-- --- .-. .-.. -..",
  "unknown": []
}
Input
{
  "text": ".... . .-.. .-.. --- / .-- --- .-. .-.. -..",
  "action": "decode"
}
Result
{
  "text": "HELLO WORLD",
  "unknown": []
}

Characters with no Morse code are reported

Input
{
  "text": "café #1"
}
Result
{
  "text": "-.-. .- ..-. / .----",
  "unknown": [
    "É",
    "#"
  ]
}

Questions

How should I write Morse for decoding?
Use "." and "-" with a space between letters and "/" between words. A new line also counts as a word break.
What happens to characters without a Morse code?
They are left out of the result and listed under "unknown". International Morse covers A-Z, 0-9 and common punctuation only.
Why is decoded text in capitals?
Morse code has no upper or lower case, so capitals are the convention.