File Organizer is a simple Python script that automatically sorts files in a chosen directory into subfolders based on their file extensions. It helps you declutter and manage your folders efficiently.
- Automatically organizes files by type (e.g., images, documents, videos).
- Creates new folders for extensions if they don’t already exist.
- Moves files into their corresponding folders safely.
- Works on Windows, macOS, and Linux.
The script scans all files within a specified folder, checks each file’s extension, and then:
- Creates a new folder named after that extension (if it doesn’t already exist).
- Moves the file into the corresponding extension folder.
Example:
If your folder contains photo.jpg, document.pdf, and script.py, it will automatically create:
jpg/
pdf/
py/
and move each file into its respective folder.
- Python 3.x
- Standard libraries:
os,shutil(no external dependencies)
-
Clone this repository:
git clone https://github.com/Code-tech77/File-Organizer.git
-
Open the folder and run the script:
python file_organizer.py
-
Enter the full path to the folder you want to organize when prompted.
Example:
Enter Folder Path: C:\Users\YourName\Downloads
The script will automatically organize all files in that directory by extension.
Before:
Downloads/
├── file1.txt
├── image1.png
├── report.pdf
After running the script:
Downloads/
├── txt/
│ └── file1.txt
├── png/
│ └── image1.png
└── pdf/
└── report.pdf
My Linkedin => https://www.linkedin.com/in/mohammed-zuoriki-856133250/