How to Convert Octal to IP Using JavaScript With HTML With Example?

Hello Friends Today, through this tutorial, I will tell you How to Octal to IP Convert Using JavaScript Without Submit Button with HTML? You can create an Octal to IP converter using JavaScript and HTML without a submit button. Here’s a simple example:


<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Octal to IP Converter</title>
body {
font-family: Arial, sans-serif;
margin: 20px;
label {
display: block;
margin-bottom: 8px;
input {
width: 100%;
padding: 8px;
margin-bottom: 16px;
box-sizing: border-box;
p {
margin-top: 0;
<h2>Octal to IP Converter</h2>
<label for="octalInput">Enter Octal Number:</label>
<input type="text" id="octalInput" placeholder="Enter octal number" oninput="convertOctalToIP(this.value)">
<p id="ipResult"></p>
function convertOctalToIP(octal) {
// Remove leading zeros from the octal input
octal = octal.replace(/^0+/, '');
// Convert octal to decimal
const decimal = parseInt(octal, 8);
// Convert decimal to IP address
const ipArray = [];
for (let i = 3; i >= 0; i--) {
ipArray.push((decimal >> (i * 8)) & 255);
// Display the result
document.getElementById('ipResult').innerHTML = `IP Address: ${ipArray.join('.')}`;

This HTML file includes an input field for entering an octal number and a result paragraph to display the corresponding IP address. The `convertOctalToIP` function is triggered whenever there is an input change in the octal input field. It converts the octal number to a decimal number and then converts the decimal to an IP address, updating the result dynamically.


Octal to IP Converter

Octal to IP Converter