{"id":8310600,"date":"2025-09-11T04:57:08","date_gmt":"2025-09-11T01:57:08","guid":{"rendered":"https:\/\/elementor.com\/tools\/?p=8310600"},"modified":"2025-09-11T05:23:36","modified_gmt":"2025-09-11T02:23:36","slug":"url-encoder","status":"publish","type":"post","link":"https:\/\/elementor.com\/tools\/url-encoder\/","title":{"rendered":"URL Encoder"},"content":{"rendered":"\t\t<div data-elementor-type=\"container\" data-elementor-id=\"8310599\" class=\"elementor elementor-8310599\" data-elementor-post-type=\"elementor_library\">\n\t\t\t\t<div class=\"elementor-element elementor-element-23691a2c e-flex e-con-boxed e-con e-parent\" data-id=\"23691a2c\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-37c3711c elementor-widget elementor-widget-html\" data-id=\"37c3711c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<style>\r\n    \/* --- General App Styles (Adapted from your code) --- *\/\r\n    .url-encoder-app {\r\n        width: 100%;\r\n        max-width: 800px; \/* Adjusted for a single-column tool *\/\r\n        margin: 0 auto;\r\n        padding: 60px 0 0;\r\n        background: transparent;\r\n        position: relative;\r\n    }\r\n\r\n    .main-content {\r\n        display: flex;\r\n        flex-direction: column;\r\n        align-items: center;\r\n        justify-content: center;\r\n        gap: 20px; \/* Spacing between the text area and buttons *\/\r\n    }\r\n\r\n    \/* --- Text Area Section Styles (Adapted from your .input-section) --- *\/\r\n    .editor-section {\r\n        width: 100%;\r\n        height: 350px;\r\n        display: flex;\r\n        flex-direction: column;\r\n        background: white;\r\n        border-radius: 8px;\r\n        overflow: hidden;\r\n        box-shadow: 0 4px 12px rgba(0,0,0,0.08);\r\n    }\r\n\r\n    .section-header {\r\n        background-color: #05047E;\r\n        color: white;\r\n        padding: 12px 20px;\r\n        font-family: 'DM Sans', sans-serif;\r\n        font-weight: 400;\r\n        font-size: 1.125rem;\r\n    }\r\n\r\n    .textarea-container {\r\n        flex: 1;\r\n        position: relative;\r\n        background-color: #ffffff;\r\n        border: 1.5px solid #EBEBEB;\r\n        border-top: none;\r\n        border-radius: 0 0 8px 8px;\r\n    }\r\n\r\n    .code-textarea {\r\n        width: 100%;\r\n        height: 100%;\r\n        border: none;\r\n        outline: none;\r\n        padding: 15px;\r\n        font-family: 'Courier New', monospace;\r\n        font-size: 14px;\r\n        line-height: 1.6;\r\n        background-color: transparent;\r\n        resize: none;\r\n        color: #333;\r\n    }\r\n\r\n    .code-textarea::placeholder {\r\n        color: #adb5bd;\r\n        font-style: italic;\r\n    }\r\n\r\n    \/* --- Controls & Button Styles (Adapted from your buttons) --- *\/\r\n    .controls-container {\r\n        display: flex;\r\n        flex-wrap: wrap;\r\n        justify-content: center;\r\n        align-items: center;\r\n        gap: 15px;\r\n        width: 100%;\r\n    }\r\n\r\n    .format-btn {\r\n        background-color: #000;\r\n        color: white;\r\n        border: none;\r\n        padding: 12px 20px;\r\n        cursor: pointer;\r\n        font-size: 1rem;\r\n        font-weight: 500;\r\n        transition: all 0.2s;\r\n        min-width: 9rem;\r\n        text-align: center;\r\n        border-radius: 4px;\r\n    }\r\n\r\n    .format-btn:is(:hover, :focus, :focus-visible, :active){\r\n        background-color: #545454;\r\n    }\r\n\r\n    \/* Primary action button style from your #minifyBtn *\/\r\n    #encodeBtn {\r\n        background-color: #ff7be5;\r\n        color: black;\r\n    }\r\n\r\n    #encodeBtn:is(:hover, :focus, :focus-visible, :active) {\r\n        background-color: #ffa8ee;\r\n    }\r\n\r\n    .copy-btn {\r\n        background-color: rgb(255, 255, 255);\r\n        color: black;\r\n        border: 1px solid #ddd;\r\n        padding: 8px 16px;\r\n        border-radius: 4px;\r\n        cursor: pointer;\r\n        font-size: 14px;\r\n        display: flex;\r\n        align-items: center;\r\n        gap: 8px;\r\n        transition: background-color 0.2s;\r\n        box-shadow: 0 0 10px rgba(0,0,0,0.05);\r\n    }\r\n    \r\n    .copy-btn:is(:hover, :focus, :focus-visible) {\r\n        background-color: #f6f6f6;\r\n    }\r\n\r\n    .reset-btn {\r\n        background: none;\r\n        border: none;\r\n        color: black;\r\n        text-decoration: underline;\r\n        font-size: 1rem;\r\n        cursor: pointer;\r\n        padding: 5px;\r\n        transition: color 0.2s;\r\n    }\r\n\r\n    .reset-btn:is(:hover, :focus, :focus-visible, :active) {\r\n        background: none;\r\n        color: #545454;\r\n        text-decoration: underline;\r\n    }\r\n    \r\n    \/* --- Utility & Feedback Styles (Copied from your code) --- *\/\r\n    .success-message {\r\n        position: fixed;\r\n        top: 20px;\r\n        right: 20px;\r\n        background-color: #28a745;\r\n        color: white;\r\n        padding: 12px 20px;\r\n        border-radius: 4px;\r\n        font-size: 14px;\r\n        opacity: 0;\r\n        transform: translateY(-20px);\r\n        transition: all 0.3s ease-in-out;\r\n        z-index: 1000;\r\n        box-shadow: 0 4px 12px rgba(0,0,0,0.15);\r\n    }\r\n\r\n    .success-message.show {\r\n        opacity: 1;\r\n        transform: translateY(0);\r\n    }\r\n\r\n    \/* --- Responsive Adjustments --- *\/\r\n    @media (max-width: 768px) {\r\n        .url-encoder-app {\r\n            padding-top: 30px;\r\n        }\r\n        .editor-section {\r\n            height: 300px;\r\n        }\r\n        .controls-container {\r\n            flex-direction: column;\r\n            gap: 12px;\r\n        }\r\n        .format-btn, .copy-btn {\r\n            width: 100%;\r\n            max-width: 320px; \/* Prevent buttons from being too wide *\/\r\n            justify-content: center;\r\n        }\r\n    }\r\n<\/style>\r\n\r\n<div class=\"url-encoder-app\">\r\n    <div class=\"main-content\">\r\n\r\n        <!-- URL Input\/Output Area -->\r\n        <div class=\"editor-section\">\r\n            <div class=\"section-header\">URL Encoder \/ Decoder<\/div>\r\n            <div class=\"textarea-container\">\r\n                <textarea id=\"urlTextarea\" class=\"code-textarea\" placeholder=\"Paste your URL or text here...\"><\/textarea>\r\n            <\/div>\r\n        <\/div>\r\n\r\n        <!-- Action Buttons -->\r\n        <div class=\"controls-container\">\r\n            <button id=\"encodeBtn\" class=\"format-btn\">Encode URL<\/button>\r\n            <button id=\"decodeBtn\" class=\"format-btn\">Decode URL<\/button>\r\n            <button id=\"copyBtn\" class=\"copy-btn\">\r\n                <svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"16\" height=\"16\" fill=\"currentColor\" viewBox=\"0 0 16 16\">\r\n                    <path d=\"M4 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V2zm2-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H6zM2 5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-1h-1v1a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h1V5H2z\"\/>\r\n                <\/svg>\r\n                <span>Copy<\/span>\r\n            <\/button>\r\n            <button id=\"resetBtn\" class=\"reset-btn\">Clear<\/button>\r\n        <\/div>\r\n        \r\n    <\/div>\r\n\r\n    <!-- Success message pop-up -->\r\n    <div id=\"successMessage\" class=\"success-message\">Copied to clipboard!<\/div>\r\n<\/div>\r\n\r\n<script>\r\n    document.addEventListener('DOMContentLoaded', function() {\r\n        \/\/ Get references to all the interactive elements\r\n        const textarea = document.getElementById('urlTextarea');\r\n        const encodeBtn = document.getElementById('encodeBtn');\r\n        const decodeBtn = document.getElementById('decodeBtn');\r\n        const copyBtn = document.getElementById('copyBtn');\r\n        const resetBtn = document.getElementById('resetBtn');\r\n        const successMessage = document.getElementById('successMessage');\r\n\r\n        \/\/ --- Event Listeners for Buttons ---\r\n\r\n        \/\/ ENCODE button functionality\r\n        encodeBtn.addEventListener('click', () => {\r\n            const originalText = textarea.value;\r\n            if (originalText) {\r\n                textarea.value = encodeURIComponent(originalText);\r\n            }\r\n        });\r\n\r\n        \/\/ DECODE button functionality\r\n        decodeBtn.addEventListener('click', () => {\r\n            const encodedText = textarea.value;\r\n            if (encodedText) {\r\n                try {\r\n                    textarea.value = decodeURIComponent(encodedText.replace(\/\\+\/g, ' '));\r\n                } catch (e) {\r\n                    \/\/ Handle cases where the input is not a valid URI component\r\n                    alert('Error: The input string is not a valid encoded URI.');\r\n                    console.error('URIError:', e);\r\n                }\r\n            }\r\n        });\r\n\r\n        \/\/ COPY button functionality\r\n        copyBtn.addEventListener('click', () => {\r\n            const textToCopy = textarea.value;\r\n            if (!textToCopy) {\r\n                return; \/\/ Do nothing if textarea is empty\r\n            }\r\n\r\n            navigator.clipboard.writeText(textToCopy).then(() => {\r\n                \/\/ On success, show the confirmation message\r\n                showSuccessMessage('Copied to clipboard!');\r\n            }).catch(err => {\r\n                console.error('Failed to copy text: ', err);\r\n                showSuccessMessage('Failed to copy!', true); \/\/ Show an error message\r\n            });\r\n        });\r\n\r\n        \/\/ RESET button functionality\r\n        resetBtn.addEventListener('click', () => {\r\n            textarea.value = '';\r\n        });\r\n\r\n        \/\/ --- Helper Function ---\r\n\r\n        \/\/ Function to show the success message for a short duration\r\n        function showSuccessMessage(message, isError = false) {\r\n            successMessage.textContent = message;\r\n            successMessage.style.backgroundColor = isError ? '#dc3545' : '#28a745';\r\n            successMessage.classList.add('show');\r\n\r\n            \/\/ Hide the message after 2.5 seconds\r\n            setTimeout(() => {\r\n                successMessage.classList.remove('show');\r\n            }, 2500);\r\n        }\r\n    });\r\n<\/script>\r\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[22],"tags":[21],"class_list":["post-8310600","post","type-post","status-publish","format-standard","hentry","category-tools","tag-html-css-tools"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>URL Encoder<\/title>\n<meta name=\"description\" content=\"Easily encode URLs with special characters using the Elementor URL Encoder. Ensure your links are safe, functional, and error-free for web sharing and development.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/elementor.com\/tools\/url-encoder\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"URL Encoder\" \/>\n<meta property=\"og:description\" content=\"Easily encode URLs with special characters using the Elementor URL Encoder. Ensure your links are safe, functional, and error-free for web sharing and development.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/elementor.com\/tools\/url-encoder\/\" \/>\n<meta property=\"og:site_name\" content=\"Tools\" \/>\n<meta property=\"article:published_time\" content=\"2025-09-11T01:57:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-11T02:23:36+00:00\" \/>\n<meta name=\"author\" content=\"liz@148.red\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"liz@148.red\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/elementor.com\/tools\/url-encoder\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/elementor.com\/tools\/url-encoder\/\"},\"author\":{\"name\":\"liz@148.red\",\"@id\":\"https:\/\/elementor.com\/tools\/#\/schema\/person\/80e8375cb95e6030bc2f897c41c985ac\"},\"headline\":\"URL Encoder\",\"datePublished\":\"2025-09-11T01:57:08+00:00\",\"dateModified\":\"2025-09-11T02:23:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/elementor.com\/tools\/url-encoder\/\"},\"wordCount\":4,\"keywords\":[\"Html-Css-tools\"],\"articleSection\":[\"tools\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/elementor.com\/tools\/url-encoder\/\",\"url\":\"https:\/\/elementor.com\/tools\/url-encoder\/\",\"name\":\"URL Encoder\",\"isPartOf\":{\"@id\":\"https:\/\/elementor.com\/tools\/#website\"},\"datePublished\":\"2025-09-11T01:57:08+00:00\",\"dateModified\":\"2025-09-11T02:23:36+00:00\",\"author\":{\"@id\":\"https:\/\/elementor.com\/tools\/#\/schema\/person\/80e8375cb95e6030bc2f897c41c985ac\"},\"description\":\"Easily encode URLs with special characters using the Elementor URL Encoder. Ensure your links are safe, functional, and error-free for web sharing and development.\",\"breadcrumb\":{\"@id\":\"https:\/\/elementor.com\/tools\/url-encoder\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/elementor.com\/tools\/url-encoder\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/elementor.com\/tools\/url-encoder\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/elementor.com\/tools\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"URL Encoder\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/elementor.com\/tools\/#website\",\"url\":\"https:\/\/elementor.com\/tools\/\",\"name\":\"Tools\",\"description\":\"Just another Elementor hosted website ;)\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/elementor.com\/tools\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/elementor.com\/tools\/#\/schema\/person\/80e8375cb95e6030bc2f897c41c985ac\",\"name\":\"liz@148.red\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/63b900d3310bd1ed40162fb27f016e9920ae66fa5be07be5153344329ef7d9d2?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/63b900d3310bd1ed40162fb27f016e9920ae66fa5be07be5153344329ef7d9d2?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/63b900d3310bd1ed40162fb27f016e9920ae66fa5be07be5153344329ef7d9d2?s=96&d=mm&r=g\",\"caption\":\"liz@148.red\"},\"url\":\"https:\/\/elementor.com\/tools\/author\/liz148-red\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"URL Encoder","description":"Easily encode URLs with special characters using the Elementor URL Encoder. Ensure your links are safe, functional, and error-free for web sharing and development.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/elementor.com\/tools\/url-encoder\/","og_locale":"en_US","og_type":"article","og_title":"URL Encoder","og_description":"Easily encode URLs with special characters using the Elementor URL Encoder. Ensure your links are safe, functional, and error-free for web sharing and development.","og_url":"https:\/\/elementor.com\/tools\/url-encoder\/","og_site_name":"Tools","article_published_time":"2025-09-11T01:57:08+00:00","article_modified_time":"2025-09-11T02:23:36+00:00","author":"liz@148.red","twitter_card":"summary_large_image","twitter_misc":{"Written by":"liz@148.red","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/elementor.com\/tools\/url-encoder\/#article","isPartOf":{"@id":"https:\/\/elementor.com\/tools\/url-encoder\/"},"author":{"name":"liz@148.red","@id":"https:\/\/elementor.com\/tools\/#\/schema\/person\/80e8375cb95e6030bc2f897c41c985ac"},"headline":"URL Encoder","datePublished":"2025-09-11T01:57:08+00:00","dateModified":"2025-09-11T02:23:36+00:00","mainEntityOfPage":{"@id":"https:\/\/elementor.com\/tools\/url-encoder\/"},"wordCount":4,"keywords":["Html-Css-tools"],"articleSection":["tools"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/elementor.com\/tools\/url-encoder\/","url":"https:\/\/elementor.com\/tools\/url-encoder\/","name":"URL Encoder","isPartOf":{"@id":"https:\/\/elementor.com\/tools\/#website"},"datePublished":"2025-09-11T01:57:08+00:00","dateModified":"2025-09-11T02:23:36+00:00","author":{"@id":"https:\/\/elementor.com\/tools\/#\/schema\/person\/80e8375cb95e6030bc2f897c41c985ac"},"description":"Easily encode URLs with special characters using the Elementor URL Encoder. Ensure your links are safe, functional, and error-free for web sharing and development.","breadcrumb":{"@id":"https:\/\/elementor.com\/tools\/url-encoder\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/elementor.com\/tools\/url-encoder\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/elementor.com\/tools\/url-encoder\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/elementor.com\/tools\/"},{"@type":"ListItem","position":2,"name":"URL Encoder"}]},{"@type":"WebSite","@id":"https:\/\/elementor.com\/tools\/#website","url":"https:\/\/elementor.com\/tools\/","name":"Tools","description":"Just another Elementor hosted website ;)","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/elementor.com\/tools\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/elementor.com\/tools\/#\/schema\/person\/80e8375cb95e6030bc2f897c41c985ac","name":"liz@148.red","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/63b900d3310bd1ed40162fb27f016e9920ae66fa5be07be5153344329ef7d9d2?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/63b900d3310bd1ed40162fb27f016e9920ae66fa5be07be5153344329ef7d9d2?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/63b900d3310bd1ed40162fb27f016e9920ae66fa5be07be5153344329ef7d9d2?s=96&d=mm&r=g","caption":"liz@148.red"},"url":"https:\/\/elementor.com\/tools\/author\/liz148-red\/"}]}},"_links":{"self":[{"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/posts\/8310600","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/comments?post=8310600"}],"version-history":[{"count":3,"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/posts\/8310600\/revisions"}],"predecessor-version":[{"id":8310605,"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/posts\/8310600\/revisions\/8310605"}],"wp:attachment":[{"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/media?parent=8310600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/categories?post=8310600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/elementor.com\/tools\/wp-json\/wp\/v2\/tags?post=8310600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}