A while back, I wrote a Firefox extension that converts pinyin with tone numbers into pinyin with tone marks. The specifics of the conversion process are identical to those of the online pinyin converter on this site.

After installing the extension, a blue square will appear on the right side of the add-on bar at the bottom of your Firefox web browser. To use the tool, type some pinyin with tone numbers into any plain text field on any web page. Then highlight the text and click on the blue 拼 on your status bar. It will convert the tone numbers into the appropriate marks over the appropriate vowels. For example, if you type in “zhong1wen2″, highlight it and hit the button, then it will be converted into “zhōngwén”.

As John suggested, I’ve also made this version add apostrophes for in words like Xī’ān. I haven’t tested all the cases yet, though.

As usual, feedback is welcome and I apologize to anyone who lost this plugin after updating Firefox. The original code works fine in the current version of FF! It’s just that when making a plugin, you have to specify the maximum version of Firefox it will work on. And once you update to a newer version than that, the plugin gets disabled automatically. In order to avoid the hassle of doing this again for a while, I’ve set this version of the plugin to work with anything between v1.5 and v25.0!
🙂

Go to the download page to get it.