Text files are the basis of the digital world: from system error logs (.log) to configuration scripts (.conf) and simple notes (.txt). On Android you can work with them both through standard tools and using specialized applications. But not all users know that even without installing additional software, modern versions of Android (starting from Android 10) can open text documents out of the box.
Problems begin when you need to not just read a file, but edit it while preserving the encoding, find a specific line in a multi-megabyte log, or convert the format. In this article we will look 5 proven methods from basic to advanced, including methods for non-root users and developers. We will place special emphasis on processing files with non-standard encodings (UTF-8, Windows-1251, KOI8-R)which often cause โcrashesโ when opening.
1. Standard Android tools: what the system can do without additional applications. data-i="54">on Xiaomi). This tool supports:
Modern versions of Android (since Android 11) have a built-in text file viewer integrated into the application "Files" (Files by Google) or the manufacturer's standard file manager (for example, Samsung My Files or MI File Manager on Xiaomi). This tool supports:
- ๐ Formats:
.txt,.csv,.log,.json,.xml,.ini,.conf - ๐ Search by content (only in files up to 10 MB)
- ๐ Copying text to the clipboard
- ๐ Auto-detection of encoding (UTF-8, Windows-1251)
To open a file in the standard way:
- Open the application "Files" (or an analogue from the manufacturer).
- Go to the folder with the desired file (for example,
DownloadsorDocuments). - Tap on the file - the system will automatically open it with the built-in viewer.
Limitations of the standard viewer:
- โ It is not possible to edit files (read only).
- โ Files larger than 50 MB are not supported.
- โ No syntax highlighting for codes (
.py,.js). - โ No file comparison function (
diff).
โ ๏ธ Attention: On devices with Android 9 and below there may be no built-in viewer. In this case, the system will offer to download the application from Google Play when you first try to open a text file.
2. Top 5 applications for reading and editing text files
If the built-in capabilities are not enough, you should pay attention to specialized applications. We tested dozens of solutions and selected 5 best s. taking into account speed, format support and additional functions.
| Application | Format support | Editing | Syntax highlighting | Max. file size | Rating (Google Play) |
|---|---|---|---|---|---|
| QuickEdit | .txt, .csv, .log, .json, .xml, .html |
โ (with cancelation) | โ (15+ languages) | 100 MB | 4.7 |
| Jota+ | .txt, .md, .py, .java, .sh |
โ (with cloud backup) | โ (30+ languages) | 500 MB | 4.6 |
| Turbo Editor | .txt, .csv, .sql, .properties |
โ (with preview) | โ (dark theme) | 1 GB | 4.5 |
| DroidEdit | .txt, .html, .css, .js, .php |
โ (with SFTP connection) | โ (customizable) | 2 GB | 4.4 |
| Text Editor (by Simple Mobile Tools) | .txt, .log, .csv, .md |
โ (without excess water) | โ | 500 MB | 4.8 |
Recommendations for choosing:
- ๐ฑ For simple editing (
.txt,.csv) โ Text Editor (minimalistic interface). - ๐ป For programmers โ Jota+ or DroidEdit (code highlighting, SFTP).
- ๐ To work with large logs (>100 MB) - Turbo Editor.
If you need to frequently work with files .csv, install CSV File Viewer โit will automatically convert the data into a table view sorted by columns.
3. Reading text files through file managers (Solid Explorer, FX File Explorer)
Advanced file managers, such as Solid Explorer or FX File Explorerhave built-in text editors with advanced features. Their key advantage is integration with cloud storage (Google Drive, Dropbox, OneDrive) and support root access for working with system files.
How to open a file through Solid Explorer:
- Install the application from Google Play (there is a 14-day trial version).
- Go to the folder with the file (for example,
/sdcard/Download/mylog.log). - Long press on the file โ "Open as" โ "Text".
- To edit, tap on the pencil icon in the upper right corner.
Advantages of Solid Explorer:
- ๐ Support
SFTP/FTPSfor remote editing of files on the server. - ๐ Automatic encoding detection (including
UTF-16,ISO-8859-1). - ๐ Access to hidden system files (required
root). - ๐ Search through the contents of files in the selected folder.
โ ๏ธ Attention: When editing system files (/system/build.prop,/data/local.prop) without root access, changes will not be saved. Such operations require Magisk or a similar tool.
Make a backup of the original file|Check for root access (Magisk)|Install a file manager with root support (Solid Explorer)|Disable signature verification (if editing) APK)-->
4. Working with text files via ADB (for developers)
If you need to read a text file on a device without a graphical interface (for example, in recovery-mode) or automating the process through scripts will help Android Debug Bridge (ADB). This method requires connecting the device to the PC and switching on the mode USB Debugging.
Basic ADB commands for working with text files:
# View file contents (first 20 lines)adb shell head -n 20 /sdcard/Download/example.log
View the entire file with scrolling
adb shell less /sdcard/Download/large_log.txt
Copying a file from a device to a PC
adb pull /sdcard/Download/config.conf C:\Users\YourName\Downloads\
Searching for a string in a file (case insensitive)
adb shell grep -i "error" /sdcard/Download/system.log
Editing a file via nano (requires busybox)
adb shell
su
nano /system/build.prop
When to use ADB:
- ๐ง For debugging applications (viewing logs
logcat). - ๐ฑ For data extraction from a non-working screen (if USB debugging was enabled in advance).
- ๐ค For automation (scripts for Bash/Python for parsing logs).
How to enable USB debugging on a locked device device?
If the screen does not respond to touches, but USB debugging was enabled earlier, connect the device to the PC and do:
adb devices
If the device is detected, you can use ADB commands to extract data. If debugging was not enabled, you will need unlocking the bootloader or contact a service center.
โ ๏ธ Attention: Commandsadb shellwith rightssucan break the systemif you edit critical files (for example,/system/framework/).Always make a backup before making changes.
5. Viewing and editing text files via Termux (Linux terminal on Android)
Termux is a full-fledged one for Android, which allows you to use classic utilities like Linux terminal for Android, which allows you to use classic utilities like vim, nano, cat and sed. Its key advantage is package manager support apt, which allows you to install additional tools (for example, dos2unix for converting line endings).
Setting up instructions Termux for working with text files:
- Install Termux from Google Play or F-Droid.
- Update packages:
pkg update && pkg upgrade - Install text editors:
pkg install nano vim - Connect to the folder with the files:
termux-setup-storage(allow access to the storage in the window that appears).
- Open the file in the editor:
nano /sdcard/Download/example.txt
Useful Termux commands for text files:
# View file from line numberingnl /sdcard/Download/data.log
Search and replace text (sed)
sed -i 's/old_text/new_text/g' /sdcard/Download/config.conf
Encoding conversion (iconv)
iconv -f WINDOWS-1251 -t UTF-8 /sdcard/Download/file.txt > /sdcard/Download/file_utf8.txt
Comparing two files (diff)
diff /sdcard/Download/file1.txt /sdcard/Download/file2.txt
Termux is the only solution for Android that supports regular expressions (regex) in commands grep/sed and allows you to automate the processing of text data through scripts on Bash or Python.
6. Solving problems with encodings ("cracking" when opening files)
One โโof the most common problems when working with text files on Android is incorrect display of characters (signs ๏ฟฝ or hieroglyphs appear instead of Cyrillic). This occurs due to a mismatch between the file encoding and the one used by the reading application.
How to determine and correct the encoding:
- Open the file in Jota+ or QuickEdit.
- Click on the settings icon (โ๏ธ) โ "Encoding".
- Try these options:
UTF-8(the most common)Windows-1251(for files from a PC)KOI8-R(outdated standard for Unix)ISO-8859-5(Cyrillic in old systems)
For automatic conversion encoding via Termux:
# Install the iconv utilitypkg install coreutils
Convert from Windows-1251 to UTF-8
iconv -f WINDOWS-1251 -t UTF-8 input.txt > output_utf8.txt
Common causes of "cracking":
- ๐พ The file was created on Windows v encoding
CP1251, but opens inUTF-8. - ๐ฑ The application does not support auto-detection of encoding (relevant for Samsung My Files).
- ๐ The file was downloaded from the Internet with an incorrect header
Content-Type.
7. Security: which text files can be dangerous
Text files are generally considered safe, but some formats can be used for attacks on the device. Risks are associated with:
- ๐ Files
.bat/.sh- if they are launched through Termux or ADBthey can execute a malicious script. - ๐ Files
.xmlwith external links - may containXXE-vulnerabilities(attacks through external entities). - ๐ Files
.urlor.desktopโcan redirect to phishing sites. - ๐ Archives with text files โmay contain
symlink attacks(for example,././etc/passwd).
How to protect yourself:
- ๐ก๏ธ Open files
.sh/.batonly in sandbox (for example, through Termux without root access). - ๐ Before opening
.xmlcheck it through online validator. - ๐ซ Do not save text files to a folder
/system/- this may disrupt the operation of Android. - ๐ Use an antivirus (for example, Malwarebytes) to scan for suspicious files.
โ ๏ธ Attention: Files with the extension.txtmay actually be renamed executable files (for example,script.txt.exe). Always check the real file type through the properties or command:file /sdcard/Download/suspicious_file.txt
FAQ: Frequently asked questions about working with text files on Android
Is it possible to open a file .pdf as a text file?
Files .pdf are binary format, not text. To extract text from them, use:
- Applications like Adobe Acrobat Reader (there is a function for copying text).
- Online services (for example, PDF to Text).
- Termux with utility
pdftotext:pkg install popplerpdftotext input.pdf output.txt
Please note: text from PDF may contain formatting artifacts (line breaks, extra spaces).
How to open a file .log size 5 GB?
For working with very large files:
- Use Termux with utilities
lessorhead/tail:less /sdcard/Download/huge.log # scrollinghead -n 1000 /sdcard/Download/huge.log # first 1000 lines
tail -n 1000 /sdcard/Download/huge.log # last 1000 lines - Install Logcat Reader (specialized application for logs).
- Transfer the file to your PC via
adb pulland open in Notepad++ or Sublime Text.
โ ๏ธ Standard text editors on Android freeze when trying to open a file >1 GB.
Why are changes not saved when editing a file on a memory card?
This is due to:
- File system: Maps
FAT32orexFATmay block writing due to mounting errors. Try reconnecting the card or formatting it inNTFS(device support required). - Access rights: Starting from Android 11, applications are prohibited from writing to the root of the memory card. Save files to a folder
Android/data/or use Solid Explorer with root access. - Antivirus: Some antiviruses (for example, Avast) block changes to files on the SD card. Add the folder to the exceptions.
How to compare two text files on Android?
For comparison (diff) use:
- Termux:
pkg install diffutilsdiff /sdcard/Download/file1.txt /sdcard/Download/file2.txt - Application Diff Checker (visual comparison with highlighting differences).
- Jota+: open both files โ click
..โ "Compare with another file".
For convenience, you can upload the difference to a new file:
diff file1.txt file2.txt > changes.diff
Is it possible to edit files in a folder /system/ without root?
No, the folder /system/ is write-protected at the Android kernel level. Workarounds:
- Use Magisk to root (requires unlocked bootloader).
- Copy the file to the user folder (
/sdcard/), edit it, and then replace the original viaadb:adb push edited_file.txt /sdcard/adb shell
su
mount -o rw,remount /system
cp /sdcard/edited_file.txt /system/original_file.txt
chmod 644 /system/original_file.txt - For temporary changes, use
bind mount(redirecting the file to the edited folder).
โ ๏ธ Editing system files can lead to bootloop (loop reboot). Always make a backup via TWRP.