Celeb Glow
general | March 29, 2026

How to replace tabs for spaces in gedit?

If you create a file using gedit, which is configured to insert 4 spaces each time you press tab. Then for some reason you edit the file and some tabs get inserted (i.e. While editing on Windows). How can you replace those tabs back to spaces using gedit?

2 Answers

To do that you just need to use the replace form and search for: \t (backslash followed by t) then replace it with four spaces.

Source

4

You can highlight, copy and paste a 'tab' from your file into the search and replace fields to achieve this in either direction tabs>spaces or spaces>tabs.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy