Articles → JavaScript → Convert English Text To Hindi Using Google API

Convert English Text To Hindi Using Google API


  1. First of all create a new HTML page.
  2. Add a reference of Google’s API on the page
  3. <script type="text/javascript" src=""></script>

  4. Add a textbox that can be used to show the conversion.
  5. <b>English to Hindi</b> : <textarea id="transliterateTxtBox"></textarea>

  6. Finally add JavaScript code and specify the source and destination language
<script type="text/javascript">
         google.load("elements", "1", {
    packages: "transliteration"

function onLoad() {
  var options = {
    sourceLanguage: google.elements.transliteration.LanguageCode.ENGLISH,
    destinationLanguage: [google.elements.transliteration.LanguageCode.HINDI],
    shortcutKey: 'ctrl+g',
    transliterationEnabled: true

  var control =
    new google.elements.transliteration.TransliterationControl(options);

Picture showing the output of converting English text to Hindi using Google API

Click to Enlarge

Posted By  -  Karan Gupta
Posted On  -  Monday, May 11, 2015


Your Email Id  
Query/FeedbackCharacters remaining 250