开放代码社区 › hutool

hutool

AI/机器学习Java

A set of tools that keep Java sweet. English Documentation Hutool是一个功能丰富且易用的 Java工具库 ,通过诸多实用工具类的使用,旨在帮助开发者快速、便捷地完成各类开发任务。 这些封装的工具涵盖了字符串、数字、集合、编码、日期、文件、IO、加密、数据库JDBC、JSON、HTTP客户端等一系列操作, 可以满足各种不同的开发需求。 Hutool名称的由来 Hutool = Hu + tool,是原公司项目底层代码剥离后的开源库,“Hu”是公司名称的表示,tool表示工具。

AI/机器学习Web后端前端工具数据库
作者:用户6868语言:Java更新:2026-10-27
仓库地址
https://gitee.com/chinabugotech/hutool.git

前往原仓库

README

<p align="center">
    <a href="https://hutool.cn/"><img src="https://cdn.jsdelivr.net/gh/looly/hutool-site/images/logo.jpg" width="45%"></a>
</p>
<p align="center">
    <strong>🍬A set of tools that keep Java sweet.</strong>
</p>
<p align="center">
    👉 <a href="https://hutool.cn">https://hutool.cn/</a> 👈
</p>

<p align="center">
    <a target="_blank" href="https://search.maven.org/artifact/cn.hutool/hutool-all">
        <img src="https://img.shields.io/maven-central/v/cn.hutool/hutool-all.svg?label=Maven%20Central" />
    </a>
    <a target="_blank" href="https://license.coscl.org.cn/MulanPSL2">
        <img src="https://img.shields.io/:license-MulanPSL2-blue.svg" />
    </a>
    <a target="_blank" href="https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html">
        <img src="https://img.shields.io/badge/JDK-8+-green.svg" />
    </a>
    <a target="_blank" href="https://app.travis-ci.com/chinabugotech/hutool">
        <img src="https://api.travis-ci.com/chinabugotech/hutool.svg?branch=v5-master" />
    </a>
    <a href="https://www.codacy.com/gh/chinabugotech/hutool/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=chinabugotech/hutool&amp;utm_campaign=Badge_Grade">
        <img src="https://app.codacy.com/project/badge/Grade/8a6897d9de7440dd9de8804c28d2871d"/>
    </a>
    <a href="https://codecov.io/gh/chinabugotech/hutool">
        <img src="https://codecov.io/gh/chinabugotech/hutool/branch/v5-master/graph/badge.svg" />
    </a>
    <a target="_blank" href='https://gitee.com/chinabugotech/hutool/stargazers'>
        <img src='https://gitee.com/chinabugotech/hutool/badge/star.svg?theme=gvp' alt='star'/>
    </a>
    <a target="_blank" href='https://github.com/chinabugotech/hutool'>
        <img src="https://img.shields.io/github/stars/chinabugotech/hutool.svg?style=social" alt="github star"/>
    </a>
    <a target="_blank" href='https://gitcode.com/chinabugotech/hutool'>
        <img src="https://gitcode.com/chinabugotech/hutool/star/badge.svg" alt="gitcode star"/>
    </a>
    <a href="https://deepwiki.com/chinabugotech/hutool">
        <img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki">
    </a>
</p>

<br/>
<p align="center">
    <a href="https://qm.qq.com/q/YsLhyheHSA">
    <img alt="" src="https://img.shields.io/badge/QQ%E7%BE%A4%E2%91%A7-667030118-orange"/></a>
</p>

-------------------------------------------------------------------------------

[**🌎English Documentation**](https://gitee.com/chinabugotech/hutool/blob/v5-master/README-EN.md)

-------------------------------------------------------------------------------

## 📚简介

`Hutool`是一个功能丰富且易用的**Java工具库**,通过诸多实用工具类的使用,旨在帮助开发者快速、便捷地完成各类开发任务。
这些封装的工具涵盖了字符串、数字、集合、编码、日期、文件、IO、加密、数据库JDBC、JSON、HTTP客户端等一系列操作,
可以满足各种不同的开发需求。

### 🎁Hutool名称的由来

Hutool = Hu + tool,是原公司项目底层代码剥离后的开源库,“Hu”是公司名称的表示,tool表示工具。Hutool谐音“糊涂”,一方面简洁易懂,一方面寓意“难得糊涂”。

### 🍺Hutool理念

`Hutool`既是一个工具集,也是一个知识库,我们从不自诩代码原创,大多数工具类都是**搬运**而来,因此:

- 你可以引入使用,也可以**拷贝**和修改使用,而**不必标注任何信息**,只是希望能把bug及时反馈回来。
- 我们努力健全**中文**注释,为源码学习者提供良好地学习环境,争取做到人人都能看得懂。

-------------------------------------------------------------------------------

## 🛠️包含组件
一个Java基础工具类,对文件、流、加密解密、转码、正则、线程、XML等JDK方法进行封装,组成各种Util工具类,同时提供以下组件:

| 模块                 |     介绍                                                                          |
|--------------------|---------------------------------------------------------------------------------- |
| hutool-aop         |     JDK动态代理封装,提供非IOC下的切面支持                                              |
| hutool-bloomFilter |     布隆过滤,提供一些Hash算法的布隆过滤                                                |
| hutool-cache       |     简单缓存实现                                                                     |
| hutool-core        |     核心,包括Bean操作、日期、各种Util等                                               |
| hutool-cron        |     定时任务模块,提供类Crontab表达式的定时任务                                          |
| hutool-crypto      |     加密解密模块,提供对称、非对称和摘要算法封装                                          |
| hutool-db          |     JDBC封装后的数据操作,基于ActiveRecord思想                                         |
| hutool-dfa         |     基于DFA模型的多关键字查找                                                         |
| hutool-extra       |     扩展模块,对第三方封装(模板引擎、邮件、Servlet、二维码、Emoji、FTP、分词等)            |
| hutool-http        |     基于HttpUrlConnection的Http客户端封装                                            |
| hutool-log         |     自动识别日志实现的日志门面                                                         |
| hutool-script      |     脚本执行封装,例如Javascript                                                      |
| hutool-setting     |     功能更强大的Setting配置文件和Properties封装                                        |
| hutool-system      |     系统参数调用封装(JVM信息等)                                                      |
| hutool-json        |     JSON实现                                                                       |
| hutool-captcha     |     图片验证码实现                                                                   |
| hutool-poi         |     针对POI中Excel和Word的封装                                                       |
| hutool-socket      |     基于Java的NIO和AIO的Socket封装                                                   |
| hutool-jwt         |     JSON Web Token (JWT)封装实现                                                    |
| hutool-ai          |     AI大模型封装实现                                                    |

可以根据需求对每个模块单独引入,也可以通过引入`hutool-all`方式引入所有模块。

-------------------------------------------------------------------------------

## 📝文档 

[📘中文文档](https://doc.hutool.cn/pages/index/)

[📘中文备用文档](https://plus.hutool.cn/)

[📙参考API](https://plus.hutool.cn/apidocs/)

[🎬视频介绍](https://www.bilibili.com/video/BV1bQ4y1M7d9?p=2)

-------------------------------------------------------------------------------



## 📦安装

### 🍊Maven
在项目的pom.xml的dependencies中加入以下内容:

```xml
<dependency>
    <groupId>cn.hutool</groupId>
    <artifactId>hutool-all</artifactId>
    <version>5.8.48</ver