How to Edit an HTML File

By Addie Kaye

While many people create and edit web pages using HTML editors, you can edit an HTML page using a simple text editor such as Windows Notepad. If you do not know HTML and want to make small changes on an HTML page, use a text editor instead of an HTML editor, as HTML editors often add unnecessary codes to the page. A text editor enables you to edit the specific code that needs changing without altering any other codes.

Things You'll Need

  • Windows Notepad
  • Web browser

Step 1

Open the Windows Notepad text editor. Press CTRL-O or select "Open" from the "File" menu to open the HTML page you wish to edit. Change the type of file from "text document" to "all files" to list all file types and not just text files. Alternatively, type "*.html" into the file name input box to list only HTML files. Browse through the directories on your computer until you find the HTML file you wish to edit.

Step 2

Select the "Save As" option under the "File" menu to rename the file before editing so that you can revert to the original copy in case you mistakenly make an undesired change. You must create a text document file with an ".html" extension. To do this, select "text documents" as the save type, but input a new file name that ends with the ".html" extension. If your HTML file is named "webpage.html," for example, rename the file to "webpage-edit.html." Select "ANSI" as the encoding type.

Step 3

Edit the HTML file the same way you would edit any other text document. Scroll down to the code that needs editing and change the file text.

Step 4

Select the "Go To" option within the "Edit" menu if you know which line of HTML code needs editing. Enter the line number into the "Go To" line input box and press "OK" to skip directly to the line that needs editing.

Step 5

Click CTRL-H or select "Replace" from within the "Edit" menu to find text within the HTML file and replace it with the new text. For example, if you want to change a website link to a new website link, input the current website link into the "Find What" input box and enter the new URL into the "Replace With" input box.

Step 6

Press the "Save" button within the "File" menu to save the updated HTML file.

Step 7

Open a web browser and preview the updated HTML file by selecting "Open" within the "File" menu. Find the HTML file on your computer and press the "Open" button. Review the changes to ensure that the changes suffice.

Step 8

Return to Windows Notepad. Select "Save As" from the "File" menu. Click on the name of the original HTML file and ensure that the save as type is "text document" and the encoding is "ANSI." Press the "Save" button. Answer "Yes" when asked if you want to replace the original file.

Tips & Warnings

  • If you are not sure if the changes you made are accurate, save a backup of the original HTML file before replacing it with the edited file so that you can restore the original backup in case of error.