Say 'Hello World' in 28 Different Programming Languages

20 Oct at 11:20

A "Hello, world!" program is a computer program that outputs "Hello, World!" on a display device. It is typically one of the simplest programs possible in almost all computer languages. As such it can be used to quickly compare syntax differences between various programming languages. It is also used to verify that a language or system is operating correctly. The following is a list of "Hello, world" programs in 28 of the most commonly used programming languages.


1. Backbone.js



2. Bash

echo "Hello World"


3. Basic

PRINT "Hello, world!"​


4. C

int main(void)
    puts("Hello, world!");


5. C++

int main()
    std::cout << "Hello, world!
    return 0;


6. C#

using System;
class Program
    public static void Main(string[] args)
        Console.WriteLine("Hello, world!");


7. Clipper

? "Hello World"


8. CoffeeScript

console.log 'Hello, world!'


9. Delphi

program HelloWorld;
  Writeln('Hello, world!');


10. HTML

 Hello World!


11. Java

import javax.swing.JFrame;  //Importing class JFrame
import javax.swing.JLabel;  //Importing class JLabel
public class HelloWorld {
    public static void main(String[] args) {
        JFrame frame = new JFrame();           //Creating frame
        frame.setTitle("Hi!");                 //Setting title frame
        frame.add(new JLabel("Hello, world!"));//Adding text to frame
        frame.pack();                          //Setting size to smallest
        frame.setLocationRelativeTo(null);     //Centering frame
        frame.setVisible(true);                //Showing frame


12. JavaScript

document.write('Hello, world!');


13. jQuery

$("body").append("Hello world!");


14. Julia

println("Hello world!")


15. Logo

print [Hello, world!]


16. MatLab

disp('Hello, world!')


17. Objective-C

int main(void)
    NSLog(@"Hello, world!
    return 0;


18. Pascal

program HelloWorld;
  WriteLn('Hello, world!');


19. Perl 5

print "Hello, world!


20. PHP


21. Processing

void setup(){
  println("Hello, world!");

22. Python

print "Hello, world!"

23. R

cat('Hello, world!

24. Ruby

puts "Hello, world!"

25. Swift

println("Hello, world!")

26. VBScript

MsgBox "Hello, World!"

27. Visual Basic .NET

Module Module1
    Sub Main()
        Console.WriteLine("Hello, world!")
    End Sub
End Module


28. XSLT

      Hello World

To find out more, check out our Web Design course here.