My spouse works remotely and regularly needs to rattle off long cryptic strings by phone. Most people don’t have a phonetic alphabets memorized and stumble when trying to convey complex strings verbally.
Within about an hour, I gave her this one-click bookmark that prompts for input, then displays the NATO phonetic equivalent.
javascript:if(input=prompt("Characters")){for(i=0,result=[],letters={a:"Alfa",b:"Bravo",c:"Charlie",d:"Delta",e:"Echo",f:"Foxtrot",g:"Golf",h:"Hotel",i:"India",j:"Juliett",k:"Kilo",l:"Lima",m:"Mike",n:"November",o:"Oscar",p:"Papa",q:"Quebec",r:"Romeo",s:"Sierra",t:"Tango",u:"Uniform",v:"Victor",w:"Whiskey",x:"Xray",y:"Yankee",z:"Zulu"};i<input.length;i++)char=input[i].toLowerCase(),item=void 0!==letters[char]?letters[char]:char,result[result.length]=input[i]==input[i].toLowerCase()?item.toLowerCase():item.toUpperCase();result.length&&(output=alert(input+":\r\n"+result.join(" ").replace(/\s+/g," ")))}
In order to execute the above code from bookmarks, you must manually add it to your browser. This way you can enter the name and URL, using the code provided above. Example using Chrome…

Here are a few screenshots to show how it works, after you create the bookmark…


As you can see, it also shows you the phonetic word in the same case as the original characters, making it easier to know when to say uppercase or lowercase during the relay. All other non-alpha characters would be in line with the phonetic conversion.

It will however convert multiple whitespace characters, including tabs and non-visible characters such as line feeds, to a single space for uniform output.
Here is an easier-to-read version of the JavaScript above used for the bookmark…
if (input = prompt('Characters')) {
result = []
letters = {a:'Alfa',b:'Bravo',c:'Charlie',d:'Delta',e:'Echo',f:'Foxtrot',g:'Golf',h:'Hotel',i:'India',j:'Juliett',k:'Kilo',l:'Lima',m:'Mike',n:'November',o:'Oscar',p:'Papa',q:'Quebec',r:'Romeo',s:'Sierra',t:'Tango',u:'Uniform',v:'Victor',w:'Whiskey',x:'Xray',y:'Yankee',z:'Zulu'}
for (i = 0; i < input.length; i++) {
char = input[i].toLowerCase()
item = (typeof letters[char] !== 'undefined') ? letters[char] : char
result[result.length] = (input[i] == input[i].toLowerCase()) ? item.toLowerCase() : item.toUpperCase()
}
if (result.length) {
output = alert(input + ':\\r\\n' + result.join(' ').replace(/\s+/g, ' '))
}
}
Note: We omit const
and let
declarations intentionally. Bookmark may be clicked multiple times in the same session, and omission avoids already defined console errors.
Alternative Phonetic Alphabets
It might be easier for some to remember these words as they are more common in daily language…
letters={a:'Adam',b:'Boy',c:'Charlie',d:'David',e:'Edward',f:'Frank',g:'George',h:'Henry',i:'Ida',j:'John',k:'King',l:'Lincoln',m:'Mike',n:'Nora',o:'Ocean',p:'Peter',q:'Queen',r:'Robert',s:'Sam',t:'Tom',u:'Union',v:'Victor',w:'William',x:'X-Ray',y:'Young',z:'Zebra'}
You can use the police phonetic alphabet like shown above, or come up with your own collection of words. Below is the bookmark code to use the police alphabet…
javascript:if(input=prompt("Characters")){for(i=0,result=[],letters={a:"Adam",b:"Boy",c:"Charlie",d:"David",e:"Edward",f:"Frank",g:"George",h:"Henry",i:"Ida",j:"John",k:"King",l:"Lincoln",m:"Mike",n:"Nora",o:"Ocean",p:"Peter",q:"Queen",r:"Robert",s:"Sam",t:"Tom",u:"Union",v:"Victor",w:"William",x:"X-Ray",y:"Young",z:"Zebra"};i<input.length;i++)char=input[i].toLowerCase(),item=void 0!==letters[char]?letters[char]:char,result[result.length]=input[i]==input[i].toLowerCase()?item.toLowerCase():item.toUpperCase();result.length&&(output=alert(input+":\r\n"+result.join(" ").replace(/\s+/g," ")))}