How to Run Wikipedia Offline on ESP32

Submitted by Anand D on

These days, we are heavily dependent on cloud computing, high-speed internet and all. We rarely think about what happens if the internet goes down or what happens in areas where the network is not reachable or information access is very difficult. The main solution is having the data and its processing locally so that they are reachable anytime, even without internet. In this project, we will be building an Offline Wikipedia that runs completely on an ESP32-S3 Board so that we can access the data anytime, anywhere without an internet connection. This is all possible thanks to Kiwix, a non-profit organisation that is making free knowledge accessible everywhere. An ESP32 offline Wikipedia is a pocket-sized Wikipedia server built on an ESP32-S3 board with a microSD card. 

We will load the data onto an SD Card and use it in the onboard SD Card reader of the ESP32 module so that it itself becomes the database. Then we will flash the firmware that runs a web server on the ESP32 so that we can access the data in any browser without the internet. Running a web server on an ESP32 becomes very helpful, as we can visualise the data anytime, anywhere using any device. If you’d like to learn the basics of running a web server on an ESP32 Dev Module, we have a getting started tutorial that helps you build a simple ESP32 LED Webserver.

What You Will Learn in This ESP32 Offline Wikipedia Tutorial

  • Selection of the appropriate ZIM file (language, flavour, and size) for the microSD card.
  • Utilisation of the ESP32 offline Wikipedia repository on GitHub for the transformation of the ZIM file into data chunks easily readable by the ESP32.
  • Preparation and setting of the FAT32-formatted microSD card with the processed data.
  • Flashing the web server firmware using PlatformIO, along with checking SD card mounting.
  • Making connection to the ESP32 Wi-Fi point and search images-containing articles through any browser.
  • Overview of how this ESP32 version compares to setups with Raspberry Pi and smartphone Kiwix.

Hardware Required for the ESP32 Offline Wikipedia

Below is the hardware required to build this project.

Components for the ESP32 offline Wikipedia: an ESP32-S3 board with an onboard microSD slot, a microSD card and a USB data cable

First of all, we need an ESP32-S3 module with a microSD card slot. The memory card used here is a 4GB one for this demonstration. Memory card size depends on the file size that will be downloaded, as per the instructions provided below. A suitable memory card size is 16 GB or 32 GB as larger the file size, larger is the information that it holds. But still, one can even use a 2 GB memory card, provided the file size is within it. Then, we need a data cable to program the ESP32 Board.

Step-by-Step Guide to Build an Offline Wikipedia on ESP32

Step 1⇒ Download the Right Kiwix ZIM File
First of all, we need to go to the Kiwix ZIM Archive Page. There are several downloadable files listed. If we take a closer look, the letters “en, af, ru, fr…” in the file name suggest that the downloadable file is in a specific language, such as English, Afrikaans, Russian, French and many more. Below is a table that shows how to properly identify the right file for the right purpose. Make sure that the downloadable file size is within the capacity of the memory card that is going to be used. 

S NoTag                                                            Meaning
1simpleSimple English Wikipedia (easier vocabulary, fewer total articles, significantly smaller file sizes)
2allContains general Wikipedia articles across all topics rather than a specific subject. 
3maxiFull version including complete text and images
4nopicText-only version (no pictures), resulting in much smaller file sizes.  
mini: Lead/intro paragraphs of articles only
52026-xxThe year and month the snapshot was taken

Apart from Wikipedia, there are files specific to topics like physics, mathematics, football, chess, etc., which have rich information about the specific topics. Make sure to check the file size of the download as well. If we don't want images in the offline wiki, we can download the file that has “nopic” in the file name.

Topic-specific Kiwix archives let you build a focused offline reference, for example only physics or mathematics

The table below shows how languages are tagged in the file name. Identify the desired language and download the file. Listed below are just some samples. Actually, a wide range of languages are available on the website for download.

Language codes used in Kiwix Wikipedia ZIM file names for the ESP32 offline Wikipedia, such as en, fr, ru and af Language codes in Kiwix file names. Choose the code for the language you want to read offline

Step 2⇒ Clone the ESP32 Offline Wikipedia GitHub Repository
We will complete the entire tutorial in VS Code with the PlatformIO extension installed. To make everything easier, all the code and files have been uploaded to GitHub and can be accessed from the GitHub link provided below. After cloning the repo, we need to be in the following directory in the terminal for the following steps.

C:\Users\Pavilion\Downloads\Offline-Wikipedia-ESP32-master\Offline-Wikipedia-ESP32-master>

Step 3⇒ Preprocess the ZIM File with Images
Below is the command to be run to preprocess/re-compress the contents of the .zim file so that the ESP32 board can read the data efficiently. It will extract all articles, render all images/diagrams into .dat chunks, and generate the index files. The default thumbnail size is 320x212, but we can use --thumb-size 480x320 for sharper images. Here, we are using 480x320 as we are aiming for sharper images.

& "C:\Users\Pavilion\.platformio\penv\Scripts\python.exe" preprocessor\build_wiki_db.py --all-jpeg --thumb-size 480x320 "C:\Users\Pavilion\Downloads\wikipedia_en-simple_all_maxi_2026-09.zim" preprocessor\output_en_wiki

Once the above command is run, we can see the following logs in the terminal. It takes a decent amount of time to complete the task, as it depends on the zim model that we are preprocessing. Once this task is successful, it creates a folder named “output_en_wiki” under the preprocessor folder. We need the contents of this folder. You can edit the final directory name (here, it is output_en_wiki) to the correct name that matches the file that you have downloaded. In this case, it's an English version of the Wiki. That's why it's named “output_en_wiki”. It can be like “output_af_wiki” if we are using the Afrikaans version. After the process, open the same folder in your file explorer and copy all the contents of that folder. Make sure the microSD card has enough space to store all the data.

Preprocessor log while converting the Simple English ZIM file into ESP32-ready chunks.

Step 4⇒ Copy the Data to the microSD Card
Plug the microSD card (16 GB or 32 GB recommended) into your PC using a card reader. Format it as FAT32. Formatting a microSD card as FAT32 is easy. In Windows, right-click the drive > Format > FAT32.
Create a folder named wiki on the root of the SD card.
Copy all files from preprocessor\output_en_wiki\ into /wiki/, the folder that we need to create inside the microSD card’s root directory. The following are the files that are to be transferred to the folder named wiki on the SD Card.

The preprocessed index and chunk files that go into the /wiki folder on the microSD card.

After copying the files, the SD card folder structure should look something like the following. All the copied files are under a root folder named wiki.

SD Card Root/
└── wiki/
   ├── index.bin
   ├── sparse_index.bin
   ├── id_index.bin
   ├── index_meta.txt
   ├── articles_0000.dat
   ├── articles_0001.dat
   ...
   ├── img_index.bin
   ├── img_meta.txt
   ├── img_0000.dat
   ├── img_0001.dat

Insert the card into the built-in Micro SD Card slot on the ESP32-S3 CAM board and proceed to the next steps.
Step 5⇒ Flash the ESP32-S3 Web Server Firmware
Connect the ESP32-S3 CAM Module via USB and run the following command. Nothing needs to be changed; it will flash the firmware directly to the ESP32 Board.

cd firmware
$env:PYTHONIOENCODING="utf-8"
& "C:\Users\Pavilion\.platformio\penv\Scripts\pio.exe" run -e s3-cam-web -t upload

Flashing the firmware doesn’t take too much time, unlike when re-compressing the data. It shows the upload progress in the terminal window, just like how we can see the upload progress in Arduino IDE when we upload code to an Arduino / ESP32 Board.

PlatformIO confirms a successful upload of the offline Wikipedia web-server firmware.

Above is the success message that will come up once the firmware is flashed successfully. If we didn’t get a success message here, the most possible reason is the board being used shouldn’t be an ESP32-S3 board. This repo highly expects an ESP32-S3 board for successful operation.

Step 6⇒ Verify the SD Card Mount in the Serial Monitor
You can watch the boot output in the Serial Monitor to verify the mount:

& "C:\Users\Pavilion\.platformio\penv\Scripts\pio.exe" device monitor

You will see the following, which indicates everything is fine and a total of 129909 articles are available. These numbers vary depending on the file that is being used.

[wiki_db] Initialising storage...
[wiki_db] Setting custom SD_MMC pins: CLK=39, CMD=38, D0=40
[wiki_db] SD_MMC mounted successfully (1-bit mode)!
[wiki_db] Database ready: 129909 articles
[wiki_db] Images: 129909 available

Step 7⇒ Connect to the Hotspot and Browse Wikipedia Offline
Power on the ESP32-S3 CAM. On your phone, tablet, or laptop, open Wi-Fi settings and connect to the Wi-Fi network named Wikipedia-Offline that's hosted by the ESP32. It will be an open network, so there's no need to enter a password.

Joining the open Wikipedia-Offline Wi-Fi network created by the ESP32-S3.

Open any web browser and go to:
http://192.168.4.1/, which is the default fallback IP for AP mode in the ESP32 network stack.
You will be greeted with the full offline Wikipedia search engine, rich articles, and high-resolution images served directly from your ESP32-S3. (The Serial Monitor also remains active simultaneously for diagnostics!) As we start to search for something in the search bar, it will bring up related contents/articles. Clicking any item from the list will display the whole content of that article.

Result: Searching and Reading Wikipedia Offline on the ESP32

The following are some snapshots from the final results. As we can see, the initial window is one that says “Welcome to Offline Wikipedia”. It shows information like the total number of articles in the memory and all. As we start to type in a keyword, the system will show available articles related to the keyword. Once we click a keyword, the screen populates with the article's content. The content includes text and images. If we opt to use or download a “nopic” version, it will show text only and not any images.

Offline Wikipedia Running in the ESP32-S3 Board

Running Wikipedia Offline on an ESP32: Video Demo

Watch the complete ESP32 offline Wikipedia in action, running on an ESP32-S3 board with nothing more than a microSD card and its own Wi-Fi hotspot. The demo shows a phone joining the Wikipedia-Offline network, searching for a topic and opening a full article with images, all without an internet connection. It is a quick way to see the final result before you start building, and to check that your own setup behaves the same way.

Practical Uses of an Offline Wikipedia Server

∗ Emergency and survival kits: reference information when mobile networks are unavailable.
∗ Countryside classrooms and libraries: an encyclopedia accessible where internet is scarce or mobile data is too expensive.
∗ Field research: carrying out research in places without coverage.
∗ Learning about embedded systems: a project for hands-on learning about SD card technology and web servers using ESP32.

Conclusion

By bringing Kiwix’s open-source ZIM archives onto a low-cost microcontroller, this project proves that you don't need expensive server gear or active Wi-Fi to access global knowledge. Whether you're building an emergency survival kit, an off-grid educational tool, or just exploring the limits of microcontrollers, pairing the ESP32 with compressed offline data puts an entire library right in the palm of your hand. You can easily modify the repo and pair it with a TFT Display so that, instead of viewing the result on a web server, you can see it on the TFT Display. As an extension of this project, you can also integrate it with an offline speech system so the Wikipedia content is read aloud. We already have an article on building an ESP32 Text-to-Speech Offline System. Another option is to use some cloud-based services to run a text-to-speech system like our Text-to-Speech System using ESP32 and Wit.ai. For more builds like this, explore our ESP32 projects.

GitHub Repository

The complete source code for this ESP32 offline Wikipedia project is available in our GitHub repository, including the Python preprocessor that converts Kiwix ZIM files and the PlatformIO firmware for the ESP32-S3 web server. Clone or download the repository, follow the steps above, and you can have your own offline Wikipedia running in a single session.

ESP32 Offline Wikipedia GitHub RepisitoryESP32 Offline Wikipedia Downloadable Zip

Frequently Asked Questions About ESP32 Offline Wikipedia

⇥ What are Kiwix ZIM files?
ZIM files are file formats that have been compressed to enable offline web content to be read. Kiwix, which is charitable in nature, provides pre-prepared ZIM files in numerous languages on various topics. These files contain all the articles, images, and a search index, meaning that the internet is not required for reading.

⇥ Which ZIM file to use with the ESP32?
Select "simple", as it is smaller than the English Wikipedia. Select "maxi" when you want to view files with images, go for "nopic" whenever you wish to see only written articles or choose "mini" for articles that have summaries only. It is wise to check the size of your download and the capacity of your microSD card because its data must fit into the card.

⇥ What microSD card size is required?
This depends on the file you are going to convert. You can fit the Simple English version that has pictures on a 4GB card, while you will need higher capacity, such as 16 GB and 32 GB, for other compilations. A 2GB card may also work in some cases where only small articles are being converted.

⇥ Why do we have to format the microSD card as FAT32?
The microSD card will be used with the SD_MMC driver of the ESP32. This driver will only work with FAT32 format. Windows formatting utility only supports FAT32 formatting for cards up to 32GB of storage size. So, to format cards larger than that, special software needs to be downloaded and used. Also, thanks to the fact that the database is saved in small chunks, the limitation of 4GB for each file in FAT32 format won't be an issue.

Explore More AI-Powered Embedded Projects

Explore these DIY projects to build intelligent embedded systems using ESP32-CAM, AI-powered speech recognition, and Arduino-based text-to-speech. Learn to describe surroundings with an AI vision assistant, convert spoken words into text, and generate speech from text using simple hardware and practical step-by-step tutorials.

ESP32-CAM AI Vision Assistant Pendant for the Visually Impaired

ESP32-CAM AI Vision Assistant Pendant for the Visually Impaired

Here in this tutorial, we are going to explore an AI Vision Assistant for Visually Impaired People using an ESP32-CAM. A vision-based solution gives feedback based on the real surroundings and situations, which is more reliable than a proximity sensor-based solution.

ESP32 Speech-to-Text using Wit.ai

ESP32 Speech-to-Text using Wit.ai

In this project, we’ll be learning how to build an ESP32 Speech-to-Text system using an ESP32 development board. We’ll use an I2S MIC to record speech and an OLED display to display the converted text.

Arduino based Text to Speech (TTS) Converter

Arduino based Text to Speech (TTS) Converter

Today in this tutorial, we will learn how to make a text-to-speech converter using Arduino. Here in this Text-to-Speech converter, we’ve used an amplifier circuit to reduce the noise and get a clear sound. The amplifier circuit is made using the IC LM386.

Have any question related to this Article?

How Semtech Thinks About IoT Devices That Have to Last in the Field

Semtech’s Robert Comanescu, Vice President of R&D and Applications for Wireless ICs, and Tamir Reshef, Vice President of Products and Applications for the Analog and Mixed Signals business unit, discussed the challenges of building IoT devices that communicate reliably and withstand real-world conditions at electronica India and productronica India 2026 in Bengaluru.