Forgot your password?

How to Save a File Inside an Image File

By Edited Oct 27, 2013 1 1


It is no secret that image manipulation software is used to add hidden data to JPEG files. Metadata, digital camera information, digital watermarks, and hyperlinks are just some of the data hidden in image files.For one reason or another, one might want to remove this data before publishing the files on the Internet. A camera can be linked to the pictures that it takes.

For our readers' convenience, we have included a link under Resources below to an article describing one method used to add, view, edit, or delete data in image files. This article is about how to save a file inside an image file. The technique is one of the older methods used to hide data inside of an image file.

Things You'll Need


  • Computer
  • Basic computer skills
  • Recollection of DOS commands and usage


Step 1 - Save a File Inside an Image File - Review this step to help in understanding the other primary steps below. Refer back to this step as needed.

  • For demonstration within this article, we will use our desktop folder located at C:UserslanwanmanDesktop
  • Our initial image file is named ehow.jpg
  • The image file that we will save inside an image file is named text.txt
  • The text file (text.txt) includes the following text: "LANWANMAN says eHow rocks" (without the quotes).
  • The final image file that will contain our text file (text.txt) will be named image.jpg

Step 2 - Place the image file and the file that you want to save in the image file on your desktop or in a folder that is easy to work in.

Example: Create folder "temp" (without the quotes) located at C: emp Copy the files to that folder.

Step 3 - Click Start, enter "cmd.exe" (without the quotes; the extension is optional) in the Start Search box, and press Enter to open the commandwindow. Navigate to the folder where you placed the needed files.

Step 4 - At the command line, type "copy /b ehow.jpg + text.txt image.jpg" (without the quotes) and press Enter.

Help: Image file "ehow.jpg" added to text file "text.txt" equals image file "image.jpg"

Step 5 - Rename the image file "image.jpg" to "image.txt" (without the quotes).

Step 6 - Using NotePad or a similar text editor, open the file named "image.txt" (result of the rename in Step 5). This is actually our image file that we save the text file in.

Recall in Step 1 when we said that the initial text file contained the text: "LANWANMAN says eHow rocks" (without the quotes).

Scroll down past all the image code to the bottom of the file (or search for LANWANMAN) and you will find the text from the text file that you saved insidethe image file when performing Step 4 above.

Step 7 - OPTIONAL: If you are familiar with and have a HEX editor, there is no need to rename the file with the .txt extension. Simply open theimage file "image.jpg" with the HEX editor and scroll down to see the text file saved inside the image file.

Tips and Warnings

DOS Commands
copy - Copies one or more files to another location.
copy /? - To view help at the command-line.
copy /b - Indicates a binary file.
Files saved inside the image file can be in other formats e.g., .doc, .xls, and others. Use the appropriate application software to open other file formats.
To save multiple files inside an image file, package them using winzip or other file compression software. Then, save the zip file inside the image file.


Photo Credits

Flickr and Original Work



Dec 2, 2009 5:37am

Notice: Undefined property: member::$fldlogin in /home/infobarrel.com/public_html/article.php on line 500

Hi Ron,

Whoo-hoo, this brings back memories! DOS was pure fun.
Have you explored steganography? There are programs that actually embed information inside other files in such a way that most people will never suspect a thing.

Another interesting avenue, more closely related to your technique, is the use of metadata writing and retrieval tools. I read something about doing this from a command prompt, but I can't remember enough to share it.


Add a new comment - No HTML
You must be logged in and verified to post a comment. Please log in or sign up to comment.

Explore InfoBarrel

Auto Business & Money Entertainment Environment Health History Home & Garden InfoBarrel University Lifestyle Sports Technology Travel & Places
© Copyright 2008 - 2016 by Hinzie Media Inc. Terms of Service Privacy Policy XML Sitemap

Follow IB Technology