Home » Computer Guides » PC Security Guides » How To Hide A File Or Folder Inside An Image.

How To Hide A File Or Folder Inside An Image.

There are many reasons to hide a file (or even a folder) away from prying eyes. And it’s especially true on a shared home computer. In this guide, I’ll show you how to hide your secret file inside an image.

Once the file is hidden, anyone looking at your computer screen will only see the picture, the secret file will be completely invisible. Only you will know that it’s there.

We’ll be using the Command Prompt to hide the file inside the image, but it’s surprisingly easy to do.

To Get Started Hiding Your File.

Although you could have your image and secret file in different folders (directories), because we’re going to be using Command Prompt, it’s much easier to do (and far less typing) if you have the picture and file in the same folder to begin with.

On my desktop, I’ve created a new folder and pasted in a picture file called “gramps.jpg” and a text file called “passwords.txt” created with Notepad.

Any image file will do but it should be a .jpg file.

If either your image or document have a file name using more than one word, rename them. Rename your image and text file to have a single word name rather than having several words, it’s easier to type.

Image file and text file are shown.
How to hide this file inside the picture.

Practice With Random Files First.

Before you attempt this with your precious secret file, I’d have a practice first with a random image that is worthless to you and a simple text file created in Notepad. That way, if you don’t get it right first time, you can always delete these files and start again.
Once you get the hang of it, then you can hide your real file.

Right click inside your folder to open the context menu.

Then left click on the “Open in Terminal” option.

If you’re using Windows 11, you might have to click “Show more Options” first.

"Open in terminal" option is indicated on the context menu.

When the Terminal window opens, check the you’re actually using Command Prompt (CMD) and not PowerShell. In order to hide your file inside an image, you need to be in Command Prompt.

Most home computers will probably have PowerShell set as the default for a terminal window. Both windows look very similar. Check in the top left corner of the window to make sure you’re using Command Prompt.

If, on your computer, the terminal opens in PowerShell, follow the next steps to change it to Command Prompt.

But if you’re already in Command Prompt, you’re good to go and can skip to the following section – “Hiding a file inside an image”.

Terminal has opened in PowerShell.
This is PowerShell.
Terminal has opened in Command Prompt.
This is Command Prompt.

Change The Default Terminal To Command Prompt.

Changing the terminal default to open in Command Prompt.
Click the small downward facing arrowhead to open a menu. On the menu, click Settings.
Default Profile options.
In the Default Profile section, click the arrowhead beside Windows PowerShell.
Command Prompt selected.
On the menu, click Command Prompt and then click the Save button at the bottom of the screen.
Close all tabs marked.
Close the window (click the X in the top right corner). A pop up will appear, “Do you want to close all tabs?”. Click Close All.

After clicking the Close All button, you’re terminal windows will close and you’ll be back to your folder. Simply right click inside your folder again, select Open in Terminal and this time the Command Prompt window will open. Great.

How To Hide A File Inside An Image.

Note that in this example, the file I’m hiding is called “passwords.txt” and the image is named “gramps.jpg“. You would, obviously, change the file and image names to be whatever your files are named.

Now that you’re in Command Prompt, you have to type in a command to hide the file inside the image and then press the Enter key on your keyboard..

type passwords.txt > gramps.jpg:passwords

Hiding a file inside an image. The command is shown in Command Prompt.

For complete clarity, let me try to spell out exactly what you need to enter into the command prompt.

  • type – you have to begin by typing the word type
  • space
  • your file name – the name of the file you want to hide, including the file extension, such as .txt .doc .docx etc.
  • another space
  • > this angled bracket sign.
  • one more space
  • your image file name – the name of the image you want to use including the .jpg file extension.
  • : a colon
  • a name for the hidden file – usually you’d just use the original file name but without the file extension.
  • press enter

After pressing the Enter key you should see something like this in Command Prompt.

If you see anything else, then you’ve probably made a typo.

Try it again, being especially careful to type in the command exactly as laid out above.

File has been hidden inside the image.

The File Is Still There.

When you return to your folder, you’ll see that you still have both the image and the file that you were trying to hide.

That’s because you haven’t moved the file, but rather you’ve copied it and it’s the copy that has been placed inside the image. The original stays where it is.

To complete the operation, you’d just delete the original file.

But before you do that, it’s best to check that it has really worked.

Hide a file inside an image.

How To Retrieve A Hidden File From An Image.

There’s not much point hiding a file inside an image if you can’t retrieve that file whenever you want it. To get the file back, you’ll need to go use Command Prompt again.

Right click inside the folder that contains your image and hidden file. Then click Open In Terminal.

At the Command Prompt, type in the name of the program that you want to use to open your hidden file. In my example, I’m just using a simple text file, so I’ll type notepad.

Then a space followed by the name of the image (including its file extension). Then a colon and the name you gave to the hidden file, in my case it was “passwords”.

notepad gramps.jpg:passwords

Press the Enter key.

How to retrieve a file hidden inside an image.

After pressing the Enter key, the hidden file will open in whichever program you chose.

You can now edit the file as you wish. When you close the program, it’ll ask if you want to save the changes, just as it normally would.

The file has been retrieved. It's a list of passwords.

How To Hide A Folder Inside An Image.

You can also hide a folder and its entire contents inside an image. There is just one caveat though, the folder must be zipped (compressed) first. Other than that, hiding the folder is exactly the same as hiding a file.

For example, here I’ve got a folder called “secret.zip” that I’ll hide within the image “gramps.jpg”. You’d change the file names to be whatever your’s are called.

Open the Command Prompt by right clicking in the folder and then selecting “Open in Terminal”.

Zipped folder to be hidden inside an image.

At the Command Prompt type

type secret.zip > gramps.jpg:secret

Hit the Enter key on your keyboard. Note that it might take a while to complete if you’re using a large folder.

The folder will be copied inside the image file.

Hiding a folder inside an image.

Don’t forget that the original folder will still be visible. The command creates a copy and it’s the copy that is hidden in the image. The original folder needs to be deleted. But I’d test it first, just to be sure it has worked.properly.

Folder is still visible.
The original folder is still there.
Folder has been deleted.
You need to delete it.

How To Retrieve A Hidden Folder From An Image.

Retrieving your hidden folder from the image is a little different from retrieving a single document. Whereas with a single file you can simply open it from within the image and then edit it, when you’re working with a folder, you have to extract the folder first.

To retrieve the hidden folder type

expand gramps.jpg:secret secret.zip

Hit the Enter key on your keyboard.

Retrieving a hidden folder from an image using Command Prompt.

After you hit the Enter key, the hidden folder will be copied from within the image and the copy will be placed in your folder.

Note that the folder is COPIED. You’re not retrieving the original folder.

That’s important because if you then make any changes, or edits, to the copied folder, it won’t be reflected, or saved into the original (hidden) folder.

The folder is being extracted.

Hiding Files And Folders Inside An Image.

When you open a single hidden file you are editing the file directly. Which means that any changes you make will be saved in the hidden file.
But when you’re working on a hidden folder, you’re not. You’re working on a copy of the hidden folder. That’s important because any changes that you’ve made won’t be saved in the hidden folder, you’ll need to re-hide the entire folder.
For that reason, if the files you’re hiding will need to be updated, edited or changed in any way, it’s much better and easier to hide them as single files.
If the files will never need to be added to, changed or edited in any way, then it’s fine to group them together inside a folder and hide that.

Summary.

Hiding a file or folder inside an image like this is quite easy to do, but will require a little practice to get it right. It mainly comes down to using the Command Prompt. Since many people aren’t that familiar with it, it can seem a little difficult, a little “clunky” if you like. But with a little practice, you’ll get the hang of it.

Whilst hiding individual files works well, since you can easily open and edit them, hiding folders is much more problematic. It’s fine for static folders that aren’t going to change, but for “live” folders, I don’t think it really works well.

If you’d like an easier way of hiding or securing folders, then try these two guides. 2 Easy Ways To Hide A Folder In Windows. and How To Password Protect A Folder.

Scroll to Top