Share via

Convert a folder of .txt files from UTF-8 to UTF-16LE

velson Horie 0 Reputation points
2026-02-17T22:01:25.6466667+00:00

I have a folder of 260 files created in Notebook with UTF-8 coding.

I shall need to convert these to .tif files, but the program to do this needs files with UTF-16LE coding.

How do I do the conversion to UTF-16LE?

Thank you.

Windows for home | Windows 11 | Files, folders, and storage
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Lychee-Ng 14,910 Reputation points Microsoft External Staff Moderator
    2026-02-18T12:20:46.9733333+00:00

    Hi velson Horie,

    Welcome to Microsoft Q&A!

    I understand that you’re trying to convert 260 .txt files saved as UTF‑8 to UTF‑16 LE. If you’re interested in using Windows-native ways to do it (no third‑party tools required) here is your option:

    • Right-click a .txt file > open with Notepad.
    • Click File > Save As > Encoding > UTF‑16 LE
    • Save to another folder to keep the originals

    An additional (less hassle) option would be to find another third-party tool, which can convert all your UTF‑8 files to UTF‑16 LE. But if you don’t want more programs on your PC, Notepad can help (though take time).


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Q&A Assist
    2026-02-17T22:01:36.67+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To convert a folder of .txt files from UTF-8 to UTF-16LE encoding, you can use the iconv command on a Linux system or a Windows PowerShell script. Here’s how you can do it in both environments:

    Using Linux (with iconv):

    1. Open a terminal.
    2. Navigate to the folder containing your .txt files.
    3. Run the following command to convert all .txt files from UTF-8 to UTF-16LE:
         for file in *.txt; do
             iconv -f UTF-8 -t UTF-16LE "$file" -o "${file%.txt}.utf16.txt"
         done
      
      This will create new files with the .utf16.txt extension.

    Using Windows PowerShell:

    1. Open PowerShell.
    2. Navigate to the folder containing your .txt files.
    3. Run the following command:
         Get-ChildItem *.txt | ForEach-Object {
             $outputFile = $_.FullName -replace '\.txt$', '.utf16.txt'
             Get-Content $_.FullName | Set-Content -Encoding Unicode $outputFile
         }
      
      This will also create new files with the .utf16.txt extension.

    After converting the files, you can then proceed to use them in your program that requires UTF-16LE encoding.


    References:


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.