Windows Notepad is a very basic text editor that comes pre-installed on all Windows Operating Systems.
Notepad may be quite simple with no syntax highlighting or Intellisines like other tools like Notepad++, but that does not stop you from writing any kind of programming or scripting code in Notepad.
Let's take a look at how to write and run "Hello World" code in Notepad for 5 popular programming languages.
JavaScript:
<!DOCTYPE html>
<html>
<body>
<script>
document.write("Hello, World!");
</script>
</body>
</html>
Make sure to save the file with .html extension.

You can open this HTML file in a web browser (such as Microsoft Edge or Google Chrome) to see the output.

Python:
print("Hello, World!")
Save the above Python code with a ".py" extension (e.g., hello.py):
To run this code, open Command Prompt or Terminal on your Windows PC, navigate to the folder where the hello.py file is located, and then run:
Java:
public class HelloWorld {
public static void main(String... args) {
System.out.println("Hello, World!");
}
}
To run it, open Command Prompt, navigate to the folder containing HelloWorld.java, and compile and run it using these commands:
C++:
#include <iostream>
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}
Make sure to save the file as hello.cpp
Ruby:
puts "Hello, World!"
Make sure to save the file as hello.rb, to run it, open Command Prompt and run:
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!