ASCII to Binary Converter
Binary Output:
Your binary conversion will appear here...
Features:
ASCII Input Area:
- A
textareafor users to input ASCII text (e.g.,Hello).
- A
Convert Button:
- Converts the ASCII text into binary.
Binary Output Display:
- Displays the binary conversion in a styled result box.
Validation:
- Ensures non-empty input before conversion.
Responsive Design:
- Optimized for all devices and screen sizes.
Styling:
- Gradient backgrounds, interactive buttons, and a clean result display for a better user experience.
How It Works:
Input Handling:
- The user enters ASCII text into the input field.
ASCII to Binary Conversion:
- Uses
charCodeAt()to get the ASCII value of each character, converts it to binary withtoString(2), and pads it to 8 bits usingpadStart().
- Uses
Output Display:
- Shows the binary conversion, separated by spaces for readability.
Error Handling:
- Displays an error message if the input is empty.
No comments:
Post a Comment