skillfed

gTTS

gTTS (Google Text-to-Speech), a Python library and CLI tool to interface with Google Translate text-to-speech API

gtts v2.5.4 5.3M downloads/30d#2,115 on PyPI2,626
Permissive license MIT Active released

What it is and what it does

gTTS is a Python wrapper around Google Translate's undocumented text-to-speech functionality. It lets you generate MP3 audio from text strings and save them to disk, pass them to other audio libraries, or stream to stdout. The library includes a customizable sentence tokenizer to handle long texts while preserving intonation, abbreviations, and decimals, and supports custom text pre-processors for pronunciation corrections.

You can use it as a Python module or via a command-line tool (gtts-cli). It supports modern Python versions (3.8–3.12) across macOS, Windows, and Linux. The project is not affiliated with Google and relies on an undocumented API, so breaking changes can occur without notice—it is explicitly different from the official Google Cloud Text-to-Speech service.

Use it for:

  • Generate spoken audio files from text for accessibility or content creation workflows.
  • Build a command-line tool to batch-convert text documents or scripts into MP3 files.
  • Integrate text-to-speech into a Python application without setting up a paid cloud service.
  • Preprocess and customize pronunciation in generated speech using text pre-processors.
  • Stream audio output directly to stdout for piping into other audio processing tools.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

gTTS converts text to speech using Google Translate's API, writing MP3 audio to files, file-like objects, or stdout via Python library or command-line tool.

Yes, if you need lightweight, free text-to-speech without cloud setup. The low install friction, active maintenance, and MIT license make it straightforward to adopt. However, be aware that it depends on Google Translate's undocumented API—upstream changes can break it without notice, and it is not a substitute for official Google Cloud Text-to-Speech if you need production-grade reliability or SLA guarantees.

Install

gtts on PyPI

pip

pip install gtts

uv

uv add gtts

poetry

poetry add gtts

Installing gTTS

Before you install

Low install friction with only two runtime dependencies (requests, click). Actively maintained with recent commits and a large user base; last release was 642 days ago but repo shows ongoing activity.

License in practice

MIT license is permissive, allowing commercial and private use with minimal restrictions—suitable for most projects.

Quickstart

pip install gTTS

from gtts import gTTS
tts = gTTS('hello')
tts.save('hello.mp3')

Requires internet access to reach Google Translate's API; relies on that undocumented endpoint remaining available.

Verify before relying

  • Whether Google Translate API changes could break the package without notice, as the description disclaims.
  • Performance characteristics when handling very long texts or batch conversions.
  • Audio quality or language support coverage compared to official Google Cloud Text-to-Speech.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 2 — requests, click
Maintenance actively maintained — 642 days since the last release
Last repo commit
First released
Downloads 5,340,702/month — #2,115 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: gTTS-2.5.4-py3-none-any.whl

Keywords: gtts, text to speech, Google Translate, TTS

Environment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIXOperating System :: POSIX :: LinuxOperating System :: UnixProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Multimedia :: Sound/Audio :: SpeechTopic :: Software Development :: Libraries

Tags

text to speech pythongoogle translate ttsmp3 audio generationgtts cli toolconvert text to audiospeech synthesis googletts library python
text-to-speechaudio-generationcli-tool

More Libraries packages