How to extract IP addresses from text
Paste log lines into Input text or load a text file with Upload text. The results show each accepted address with its type, port, source line, and nearby context. IPv4 octets, IPv6 groups, and ports are checked before a match is added.
How to use the IP address extractor
- Paste log lines or other text into
Input text, or useUpload textto load a text file. - Choose
Include IPv4orInclude IPv6to control which address types appear. - Set
Unique onlyandRetain portsfor the output you need. - Review
Extracted IP addresses, then useCopy extracted addressesorDownload extracted addresses.
What Retain ports changes
Retain ports keeps an accepted port beside the address in the output and in the Port column. Brackets separate an IPv6 address from its port:
connect from 192.168.1.10:52344
[2001:db8::1]:8443
The displayed values are 192.168.1.10:52344 and [2001:db8::1]:8443. Clear the option to show only the address. A port is separated for bracketed IPv6 and IPv4; an unbracketed IPv6 match has no separated port.
How Unique only and IP type filters work
Unique only removes repeated matches. With ports retained, the address and port are compared together, so these remain separate:
10.0.0.1:443
10.0.0.1:8443
Clear Retain ports and both lines become the same displayed address, so one remains when Unique only is checked. Clear Include IPv4 or Include IPv6 to leave that address type out.
How IP address validation handles logs
IPv4 candidates are checked octet by octet. Each octet must be between 0 and 255, so 999.1.1.1 and 10.0.0.256 are left out. IPv6 validation covers compressed forms and embedded IPv4, including ::ffff:192.168.1.10, which stays one IPv6 match.
The results table has Address, Type, Port, Line, and Context columns. The output box contains the displayed address values. The tool checks syntax only, so it does not ping, connect to, geolocate, or test reachability.
Where this comes up
- For connection logs, keep both address types and use the
LineandContextcolumns to find each match in its source entry. - For a URL or proxy log, retain
[2001:db8::1]:8443as one displayed value with its port. - For repeated configuration entries, clear
Unique onlyto keep each occurrence, then copy the displayed list.
When another text extractor fits better
Use this IP address extractor for syntax-checked IPv4 or IPv6 values with type, line, and context details. Use Text Parsing & Data Extraction when you need another kind of text parser. Extract Domain Names fits hostnames in URLs or HTML. Extract Lines Containing a String fits lines selected by words or a regular expression. Custom Regex Extractor fits a pattern you define.
Frequently asked questions
How do I extract IP addresses from text?
Paste the text into Input text or use Upload text, then review the matches under Extracted IP addresses. Use the type checkboxes to limit the list.
Does the IP address extractor keep ports?
Yes. When Retain ports is checked, accepted IPv4 ports and bracketed IPv6 ports stay in the displayed value. Clear it to output addresses without separated ports.
Can I extract IPv4 and IPv6 addresses together?
Yes. Both types are included when Include IPv4 and Include IPv6 are checked. An embedded IPv4 form such as ::ffff:192.168.1.10 stays part of its IPv6 match.
What happens to invalid IP addresses?
Invalid candidates are left out of the results. IPv4 octets outside 0 through 255, malformed IPv6 groups, and ports outside 0 through 65535 are rejected.