Volver a los servicios

Editor SVG online

Edita código SVG en el navegador con vista previa en vivo y descarga directa.

El archivo se procesa localmente en el navegador • no se sube al servidor • descarga el SVG final.

Vista previa

Sin archivo
Carga un SVG Tras cargarlo, la imagen aparecerá aquí y se actualizará al editar el código.
Tamaño: — Archivo: —

Código SVG

Actualización en vivo
0 caracteres Los cambios se aplican automáticamente

Más información sobre la herramienta — Editor SVG online

Edita código SVG en el navegador con vista previa en vivo y descarga directa.

Carga un archivo SVG o pega el código XML, cambia colores, tamaños, texto, líneas y otros parámetros, comprueba el resultado al instante y guarda el SVG final. La herramienta funciona directamente desde la página web de DEVNEW.ORG y no requiere instalar software adicional. Es útil para propietarios de sitios, desarrolladores, especialistas SEO, diseñadores y cualquier persona que necesite una utilidad online rápida. Puede usarse gratis para tareas profesionales y personales.

Ver también

'; empty.style.display = 'none'; frame.style.display = 'block'; setStatusOk(); updateMeta(result.root, source); } function parseAndSanitize(source) { try { const parser = new DOMParser(); const doc = parser.parseFromString(source, 'image/svg+xml'); const parseError = doc.querySelector('parsererror'); if (parseError) { return { ok: false, error: 'El código SVG contiene un error de sintaxis.' }; } const root = doc.documentElement; if (!root || root.nodeName.toLowerCase() !== 'svg') { return { ok: false, error: 'El código debe contener un elemento raíz .' }; } sanitizeSvg(root); return { ok: true, root: root, svg: new XMLSerializer().serializeToString(root) }; } catch (e) { return { ok: false, error: 'No se pudo analizar el código SVG.' }; } } function sanitizeSvg(root) { const blockedTags = [ 'script', 'foreignObject', 'iframe', 'object', 'embed', 'audio', 'video' ]; blockedTags.forEach(function (tag) { root.querySelectorAll(tag).forEach(function (node) { node.remove(); }); }); root.querySelectorAll('*').forEach(function (node) { Array.from(node.attributes).forEach(function (attr) { const name = attr.name.toLowerCase(); const value = String(attr.value || '').trim().toLowerCase(); if (name.startsWith('on')) { node.removeAttribute(attr.name); return; } if ( (name === 'href' || name === 'xlink:href') && ( value.startsWith('javascript:') || value.startsWith('http://') || value.startsWith('https://') || value.startsWith('//') ) ) { node.removeAttribute(attr.name); } }); }); } function updateMeta(root, source) { let width = root.getAttribute('width') || ''; let height = root.getAttribute('height') || ''; const viewBox = root.getAttribute('viewBox') || ''; if ((!width || !height) && viewBox) { const values = viewBox.trim().split(/\s+/); if (values.length === 4) { if (!width) width = values[2]; if (!height) height = values[3]; } } dimensions.textContent = 'Tamaño: ' + (width && height ? width + ' × ' + height : 'no especificado'); const bytes = new Blob([source]).size; fileSize.textContent = 'Файл: ' + formatBytes(bytes); } function clearPreview() { frame.srcdoc = ''; frame.style.display = 'none'; empty.style.display = 'block'; status.className = 'svg-status'; status.innerHTML = ' Sin archivo'; dimensions.textContent = 'Tamaño: —'; fileSize.textContent = 'Archivo: —'; chars.textContent = code.value.length + ' caracteres'; hideError(); } function setStatusOk() { status.className = 'svg-status ok'; status.innerHTML = ' SVG válido'; } function setStatusError() { status.className = 'svg-status error'; status.innerHTML = ' Ошибка кода'; } function showError(message) { errorBox.textContent = message; errorBox.style.display = 'block'; } function hideError() { errorBox.textContent = ''; errorBox.style.display = 'none'; } function formatBytes(bytes) { if (bytes >= 1024 * 1024) { return (bytes / 1024 / 1024).toFixed(2) + ' MB'; } if (bytes >= 1024) { return (bytes / 1024).toFixed(2) + ' KB'; } return bytes + ' Б'; } function prettyXml(xml) { xml = xml.replace(/>\s*<'); const nodes = xml.replace(//.test(trimmed)) { pad = Math.max(0, pad - 1); } out += ' '.repeat(pad) + trimmed + '\n'; if ( /^<[^!?/][^>]*[^/]?>$/.test(trimmed) && !/^<(path|circle|rect|line|polyline|polygon|ellipse|use|image|stop|br)\b/i.test(trimmed) && !trimmed.includes('